15c02ac1a9c1b504631c0a3d2b6e737b5d738bae1Bo Liu// Copyright 2014 The Chromium Authors. All rights reserved. 2a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// found in the LICENSE file. 4a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "components/bookmarks/browser/bookmark_node_data.h" 6a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "components/bookmarks/browser/bookmark_pasteboard_helper_mac.h" 8a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 95f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)namespace bookmarks { 105f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 11a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)// static 12a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)bool BookmarkNodeData::ClipboardContainsBookmarks() { 134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return PasteboardContainsBookmarks(ui::CLIPBOARD_TYPE_COPY_PASTE); 14a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)} 15a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)void BookmarkNodeData::WriteToClipboard(ui::ClipboardType type) { 174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) WriteBookmarksToPasteboard(type, elements, profile_path_); 18a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)} 19a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) { 21a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) base::FilePath file_path; 224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) if (ReadBookmarksFromPasteboard(type, elements, &file_path)) { 234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) profile_path_ = file_path; 244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return true; 25a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) } 26a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) 274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return false; 28a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)} 295f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) 305f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)} // namespace bookmarks 31