summaryrefslogtreecommitdiffstats
path: root/components/bookmarks/browser/bookmark_node_data_mac.cc
blob: 15238855ebc2d5ea5b8f292af0e64161988911f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/bookmarks/browser/bookmark_node_data.h"

#include "components/bookmarks/browser/bookmark_pasteboard_helper_mac.h"

// static
bool BookmarkNodeData::ClipboardContainsBookmarks() {
  return PasteboardContainsBookmarks(ui::CLIPBOARD_TYPE_COPY_PASTE);
}

void BookmarkNodeData::WriteToClipboard(ui::ClipboardType type) {
  WriteBookmarksToPasteboard(type, elements, profile_path_);
}

bool BookmarkNodeData::ReadFromClipboard(ui::ClipboardType type) {
  base::FilePath file_path;
  if (ReadBookmarksFromPasteboard(type, elements, &file_path)) {
    profile_path_ = file_path;
    return true;
  }

  return false;
}