Home | History | Annotate | Download | only in bookmarks
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/bookmarks/bookmark_node_data.h"
      6 
      7 #include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
      8 
      9 // static
     10 bool BookmarkNodeData::ClipboardContainsBookmarks() {
     11   return bookmark_pasteboard_helper_mac::PasteboardContainsBookmarks(
     12       bookmark_pasteboard_helper_mac::kCopyPastePasteboard);
     13 }
     14 
     15 void BookmarkNodeData::WriteToClipboard() const {
     16   bookmark_pasteboard_helper_mac::WriteToPasteboard(
     17       bookmark_pasteboard_helper_mac::kCopyPastePasteboard,
     18       elements,
     19       profile_path_);
     20 }
     21 
     22 bool BookmarkNodeData::ReadFromClipboard() {
     23   base::FilePath file_path;
     24   if (!bookmark_pasteboard_helper_mac::ReadFromPasteboard(
     25           bookmark_pasteboard_helper_mac::kCopyPastePasteboard,
     26           elements,
     27           &file_path)) {
     28     return false;
     29   }
     30 
     31   profile_path_ = file_path;
     32   return true;
     33 }
     34 
     35 bool BookmarkNodeData::ReadFromDragClipboard() {
     36   base::FilePath file_path;
     37   if (!bookmark_pasteboard_helper_mac::ReadFromPasteboard(
     38           bookmark_pasteboard_helper_mac::kDragPasteboard,
     39           elements,
     40           &file_path)) {
     41     return false;
     42   }
     43 
     44   profile_path_ = file_path;
     45   return true;
     46 }
     47