summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-26 23:12:49 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-26 23:12:49 +0000
commitdd059852a027d4850bc68dc1e6f2ecdb300cfa8e (patch)
tree8493d5442f2c4676e7c8753e367638f68ba9fd7a /chrome/browser
parent398d24f2ee4e9b5bdb8a66751c1c8ca95c268843 (diff)
downloadchromium_src-dd059852a027d4850bc68dc1e6f2ecdb300cfa8e.zip
chromium_src-dd059852a027d4850bc68dc1e6f2ecdb300cfa8e.tar.gz
chromium_src-dd059852a027d4850bc68dc1e6f2ecdb300cfa8e.tar.bz2
Rename BookmarkDragData to BookmarkNodeData. Part 2.
BUG=37891 TEST=trybots Review URL: http://codereview.chromium.org/5249001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc4
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data.cc64
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data.h38
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data_unittest.cc54
-rw-r--r--chrome/browser/bookmarks/bookmark_drop_info.h2
-rw-r--r--chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h2
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc2
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.h2
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_bar_controller.mm6
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_bar_controller_unittest.mm2
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller.mm6
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm2
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_button.h4
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_drag_source.h6
-rw-r--r--chrome/browser/cocoa/bookmarks/bookmark_drag_source.mm2
-rw-r--r--chrome/browser/cocoa/web_contents_drag_source.h2
-rw-r--r--chrome/browser/cocoa/web_drop_target.mm8
-rw-r--r--chrome/browser/extensions/extension_bookmark_manager_api.cc38
-rw-r--r--chrome/browser/extensions/extension_bookmark_manager_api.h20
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc2
-rw-r--r--chrome/browser/gtk/bookmark_utils_gtk.cc6
-rw-r--r--chrome/browser/renderer_host/render_view_host_delegate.h10
-rw-r--r--chrome/browser/tab_contents/web_drag_dest_gtk.cc6
-rw-r--r--chrome/browser/tab_contents/web_drag_dest_gtk.h4
-rw-r--r--chrome/browser/tab_contents/web_drop_target_win.cc10
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view.cc10
-rw-r--r--chrome/browser/ui/views/bookmark_bar_view.h6
-rw-r--r--chrome/browser/ui/views/bookmark_menu_controller_views.cc6
-rw-r--r--chrome/browser/ui/views/bookmark_menu_controller_views.h4
-rw-r--r--chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc8
30 files changed, 164 insertions, 172 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
index e9ffe3d..9f9e7f1 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/autocomplete/autocomplete_edit.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
#include "chrome/browser/autocomplete/autocomplete_popup_model.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/defaults.h"
@@ -1429,7 +1429,7 @@ void AutocompleteEditViewGtk::HandleCopyOrCutClipboard(bool copy) {
if (write_url) {
string16 text16(WideToUTF16(text));
- BookmarkDragData data;
+ BookmarkNodeData data;
data.ReadFromTuple(url, text16);
data.WriteToClipboard(NULL);
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc
index 44ab58e..a31f7aa 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "app/clipboard/scoped_clipboard_writer.h"
#include "base/basictypes.h"
@@ -18,13 +18,13 @@
#include "chrome/browser/browser_process.h"
#include "net/base/escape.h"
-const char* BookmarkDragData::kClipboardFormatString =
+const char* BookmarkNodeData::kClipboardFormatString =
"chromium/x-bookmark-entries";
-BookmarkDragData::Element::Element() : is_url(false), id_(0) {
+BookmarkNodeData::Element::Element() : is_url(false), id_(0) {
}
-BookmarkDragData::Element::Element(const BookmarkNode* node)
+BookmarkNodeData::Element::Element(const BookmarkNode* node)
: is_url(node->is_url()),
url(node->GetURL()),
title(node->GetTitle()),
@@ -33,10 +33,10 @@ BookmarkDragData::Element::Element(const BookmarkNode* node)
children.push_back(Element(node->GetChild(i)));
}
-BookmarkDragData::Element::~Element() {
+BookmarkNodeData::Element::~Element() {
}
-void BookmarkDragData::Element::WriteToPickle(Pickle* pickle) const {
+void BookmarkNodeData::Element::WriteToPickle(Pickle* pickle) const {
pickle->WriteBool(is_url);
pickle->WriteString(url.spec());
pickle->WriteString16(title);
@@ -50,7 +50,7 @@ void BookmarkDragData::Element::WriteToPickle(Pickle* pickle) const {
}
}
-bool BookmarkDragData::Element::ReadFromPickle(Pickle* pickle,
+bool BookmarkNodeData::Element::ReadFromPickle(Pickle* pickle,
void** iterator) {
std::string url_spec;
if (!pickle->ReadBool(iterator, &is_url) ||
@@ -77,35 +77,35 @@ bool BookmarkDragData::Element::ReadFromPickle(Pickle* pickle,
#if defined(TOOLKIT_VIEWS)
// static
-OSExchangeData::CustomFormat BookmarkDragData::GetBookmarkCustomFormat() {
+OSExchangeData::CustomFormat BookmarkNodeData::GetBookmarkCustomFormat() {
static OSExchangeData::CustomFormat format;
static bool format_valid = false;
if (!format_valid) {
format_valid = true;
format = OSExchangeData::RegisterCustomFormat(
- BookmarkDragData::kClipboardFormatString);
+ BookmarkNodeData::kClipboardFormatString);
}
return format;
}
#endif
-BookmarkDragData::BookmarkDragData() {
+BookmarkNodeData::BookmarkNodeData() {
}
-BookmarkDragData::BookmarkDragData(const BookmarkNode* node) {
+BookmarkNodeData::BookmarkNodeData(const BookmarkNode* node) {
elements.push_back(Element(node));
}
-BookmarkDragData::BookmarkDragData(
+BookmarkNodeData::BookmarkNodeData(
const std::vector<const BookmarkNode*>& nodes) {
ReadFromVector(nodes);
}
-BookmarkDragData::~BookmarkDragData() {
+BookmarkNodeData::~BookmarkNodeData() {
}
-bool BookmarkDragData::ReadFromVector(
+bool BookmarkNodeData::ReadFromVector(
const std::vector<const BookmarkNode*>& nodes) {
Clear();
@@ -118,7 +118,7 @@ bool BookmarkDragData::ReadFromVector(
return true;
}
-bool BookmarkDragData::ReadFromTuple(const GURL& url, const string16& title) {
+bool BookmarkNodeData::ReadFromTuple(const GURL& url, const string16& title) {
Clear();
if (!url.is_valid())
@@ -135,7 +135,7 @@ bool BookmarkDragData::ReadFromTuple(const GURL& url, const string16& title) {
}
#if !defined(OS_MACOSX)
-void BookmarkDragData::WriteToClipboard(Profile* profile) const {
+void BookmarkNodeData::WriteToClipboard(Profile* profile) const {
ScopedClipboardWriter scw(g_browser_process->clipboard());
// If there is only one element and it is a URL, write the URL to the
@@ -160,7 +160,7 @@ void BookmarkDragData::WriteToClipboard(Profile* profile) const {
scw.WritePickledData(pickle, kClipboardFormatString);
}
-bool BookmarkDragData::ReadFromClipboard() {
+bool BookmarkNodeData::ReadFromClipboard() {
std::string data;
Clipboard* clipboard = g_browser_process->clipboard();
clipboard->ReadData(kClipboardFormatString, &data);
@@ -188,32 +188,32 @@ bool BookmarkDragData::ReadFromClipboard() {
return false;
}
-bool BookmarkDragData::ClipboardContainsBookmarks() {
+bool BookmarkNodeData::ClipboardContainsBookmarks() {
return g_browser_process->clipboard()->IsFormatAvailableByString(
- BookmarkDragData::kClipboardFormatString, Clipboard::BUFFER_STANDARD);
+ BookmarkNodeData::kClipboardFormatString, Clipboard::BUFFER_STANDARD);
}
#else
-void BookmarkDragData::WriteToClipboard(Profile* profile) const {
+void BookmarkNodeData::WriteToClipboard(Profile* profile) const {
bookmark_pasteboard_helper_mac::WriteToClipboard(elements, profile_path_);
}
-bool BookmarkDragData::ReadFromClipboard() {
+bool BookmarkNodeData::ReadFromClipboard() {
return bookmark_pasteboard_helper_mac::ReadFromClipboard(elements,
&profile_path_);
}
-bool BookmarkDragData::ReadFromDragClipboard() {
+bool BookmarkNodeData::ReadFromDragClipboard() {
return bookmark_pasteboard_helper_mac::ReadFromDragClipboard(elements,
&profile_path_);
}
-bool BookmarkDragData::ClipboardContainsBookmarks() {
+bool BookmarkNodeData::ClipboardContainsBookmarks() {
return bookmark_pasteboard_helper_mac::ClipboardContainsBookmarks();
}
#endif // !defined(OS_MACOSX)
#if defined(TOOLKIT_VIEWS)
-void BookmarkDragData::Write(Profile* profile, OSExchangeData* data) const {
+void BookmarkNodeData::Write(Profile* profile, OSExchangeData* data) const {
DCHECK(data);
// If there is only one element and it is a URL, write the URL to the
@@ -232,7 +232,7 @@ void BookmarkDragData::Write(Profile* profile, OSExchangeData* data) const {
data->SetPickledData(GetBookmarkCustomFormat(), data_pickle);
}
-bool BookmarkDragData::Read(const OSExchangeData& data) {
+bool BookmarkNodeData::Read(const OSExchangeData& data) {
elements.clear();
profile_path_.clear();
@@ -256,7 +256,7 @@ bool BookmarkDragData::Read(const OSExchangeData& data) {
}
#endif
-void BookmarkDragData::WriteToPickle(Profile* profile, Pickle* pickle) const {
+void BookmarkNodeData::WriteToPickle(Profile* profile, Pickle* pickle) const {
FilePath path = profile ? profile->GetPath() : FilePath();
FilePath::WriteStringTypeToPickle(pickle, path.value());
pickle->WriteSize(elements.size());
@@ -265,7 +265,7 @@ void BookmarkDragData::WriteToPickle(Profile* profile, Pickle* pickle) const {
elements[i].WriteToPickle(pickle);
}
-bool BookmarkDragData::ReadFromPickle(Pickle* pickle) {
+bool BookmarkNodeData::ReadFromPickle(Pickle* pickle) {
void* data_iterator = NULL;
size_t element_count;
if (FilePath::ReadStringTypeFromPickle(pickle, &data_iterator,
@@ -284,7 +284,7 @@ bool BookmarkDragData::ReadFromPickle(Pickle* pickle) {
return true;
}
-std::vector<const BookmarkNode*> BookmarkDragData::GetNodes(
+std::vector<const BookmarkNode*> BookmarkNodeData::GetNodes(
Profile* profile) const {
std::vector<const BookmarkNode*> nodes;
@@ -303,24 +303,24 @@ std::vector<const BookmarkNode*> BookmarkDragData::GetNodes(
return nodes;
}
-const BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const {
+const BookmarkNode* BookmarkNodeData::GetFirstNode(Profile* profile) const {
std::vector<const BookmarkNode*> nodes = GetNodes(profile);
return nodes.size() == 1 ? nodes[0] : NULL;
}
-void BookmarkDragData::Clear() {
+void BookmarkNodeData::Clear() {
profile_path_.clear();
elements.clear();
}
-void BookmarkDragData::SetOriginatingProfile(Profile* profile) {
+void BookmarkNodeData::SetOriginatingProfile(Profile* profile) {
DCHECK(profile_path_.empty());
if (profile)
profile_path_ = profile->GetPath().value();
}
-bool BookmarkDragData::IsFromProfile(Profile* profile) const {
+bool BookmarkNodeData::IsFromProfile(Profile* profile) const {
// An empty path means the data is not associated with any profile.
return !profile_path_.empty() && profile_path_ == profile->GetPath().value();
}
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.h b/chrome/browser/bookmarks/bookmark_drag_data.h
index 55c9c7b..8b8310d 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.h
+++ b/chrome/browser/bookmarks/bookmark_drag_data.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_
-#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_
+#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_
+#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_
#pragma once
#include <vector>
@@ -20,28 +20,25 @@ class BookmarkNode;
class Pickle;
class Profile;
-// TODO(mrossetti): Rename BookmarkDragData to BookmarkNodeData, update comment.
-// See: http://crbug.com/37891
-
-// BookmarkDragData is used to represent the following:
+// BookmarkNodeData is used to represent the following:
//
// . A single URL.
// . A single node from the bookmark model.
// . A set of nodes from the bookmark model.
//
-// BookmarkDragData is used by bookmark related views to represent a dragged
+// BookmarkNodeData is used by bookmark related views to represent a dragged
// bookmark or bookmarks.
//
// Typical usage when writing data for a drag is:
-// BookmarkDragData data(node_user_is_dragging);
+// BookmarkNodeData data(node_user_is_dragging);
// data.Write(os_exchange_data_for_drag);
//
// Typical usage to read is:
-// BookmarkDragData data;
+// BookmarkNodeData data;
// if (data.Read(os_exchange_data))
// // data is valid, contents are in elements.
-struct BookmarkDragData {
+struct BookmarkNodeData {
// Element represents a single node.
struct Element {
Element();
@@ -64,7 +61,7 @@ struct BookmarkDragData {
return id_;
}
private:
- friend struct BookmarkDragData;
+ friend struct BookmarkNodeData;
// For reading/writing this Element.
void WriteToPickle(Pickle* pickle) const;
@@ -74,17 +71,17 @@ struct BookmarkDragData {
int64 id_;
};
- BookmarkDragData();
+ BookmarkNodeData();
#if defined(TOOLKIT_VIEWS)
static OSExchangeData::CustomFormat GetBookmarkCustomFormat();
#endif
- // Created a BookmarkDragData populated from the arguments.
- explicit BookmarkDragData(const BookmarkNode* node);
- explicit BookmarkDragData(const std::vector<const BookmarkNode*>& nodes);
+ // Created a BookmarkNodeData populated from the arguments.
+ explicit BookmarkNodeData(const BookmarkNode* node);
+ explicit BookmarkNodeData(const std::vector<const BookmarkNode*>& nodes);
- ~BookmarkDragData();
+ ~BookmarkNodeData();
// Reads bookmarks from the given vector.
bool ReadFromVector(const std::vector<const BookmarkNode*>& nodes);
@@ -156,7 +153,7 @@ struct BookmarkDragData {
// The actual elements written to the clipboard.
std::vector<Element> elements;
- // The MIME type for the clipboard format for BookmarkDragData.
+ // The MIME type for the clipboard format for BookmarkNodeData.
static const char* kClipboardFormatString;
static bool ClipboardContainsBookmarks();
@@ -166,9 +163,4 @@ struct BookmarkDragData {
FilePath::StringType profile_path_;
};
-// TODO(tfarina): Remove this when we finish renaming all the remaining entries.
-// This is a temporary hack, to make it possible to convert all the entries in
-// small chunks. See crbug.com/37891 for context.
-typedef BookmarkDragData BookmarkNodeData;
-
-#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_DRAG_DATA_H_
+#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_NODE_DATA_H_
diff --git a/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc b/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
index 331a78a..a81d0a0 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data_unittest.cc
@@ -8,16 +8,16 @@
#include "base/scoped_ptr.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/test/testing_profile.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
-class BookmarkDragDataTest : public testing::Test {
+class BookmarkNodeDataTest : public testing::Test {
public:
- BookmarkDragDataTest()
+ BookmarkNodeDataTest()
: ui_thread_(BrowserThread::UI, &loop_),
file_thread_(BrowserThread::FILE, &loop_) { }
@@ -36,30 +36,30 @@ OSExchangeData::Provider* CloneProvider(const OSExchangeData& data) {
} // namespace
-// Makes sure BookmarkDragData is initially invalid.
-TEST_F(BookmarkDragDataTest, InitialState) {
- BookmarkDragData data;
+// Makes sure BookmarkNodeData is initially invalid.
+TEST_F(BookmarkNodeDataTest, InitialState) {
+ BookmarkNodeData data;
EXPECT_FALSE(data.is_valid());
}
-// Makes sure reading bogus data leaves the BookmarkDragData invalid.
-TEST_F(BookmarkDragDataTest, BogusRead) {
+// Makes sure reading bogus data leaves the BookmarkNodeData invalid.
+TEST_F(BookmarkNodeDataTest, BogusRead) {
OSExchangeData data;
- BookmarkDragData drag_data;
+ BookmarkNodeData drag_data;
EXPECT_FALSE(drag_data.Read(OSExchangeData(CloneProvider(data))));
EXPECT_FALSE(drag_data.is_valid());
}
-// Writes a URL to the clipboard and make sure BookmarkDragData can correctly
+// Writes a URL to the clipboard and make sure BookmarkNodeData can correctly
// read it.
-TEST_F(BookmarkDragDataTest, JustURL) {
+TEST_F(BookmarkNodeDataTest, JustURL) {
const GURL url("http://google.com");
const std::wstring title(L"title");
OSExchangeData data;
data.SetURL(url, title);
- BookmarkDragData drag_data;
+ BookmarkNodeData drag_data;
EXPECT_TRUE(drag_data.Read(OSExchangeData(CloneProvider(data))));
EXPECT_TRUE(drag_data.is_valid());
ASSERT_EQ(1, drag_data.elements.size());
@@ -69,7 +69,7 @@ TEST_F(BookmarkDragDataTest, JustURL) {
EXPECT_EQ(0, drag_data.elements[0].children.size());
}
-TEST_F(BookmarkDragDataTest, URL) {
+TEST_F(BookmarkNodeDataTest, URL) {
// Write a single node representing a URL to the clipboard.
TestingProfile profile;
profile.CreateBookmarkModel(false);
@@ -80,7 +80,7 @@ TEST_F(BookmarkDragDataTest, URL) {
GURL url(GURL("http://foo.com"));
const string16 title(ASCIIToUTF16("blah"));
const BookmarkNode* node = model->AddURL(root, 0, title, url);
- BookmarkDragData drag_data(node);
+ BookmarkNodeData drag_data(node);
EXPECT_TRUE(drag_data.is_valid());
ASSERT_EQ(1, drag_data.elements.size());
EXPECT_TRUE(drag_data.elements[0].is_url);
@@ -91,7 +91,7 @@ TEST_F(BookmarkDragDataTest, URL) {
// Now read the data back in.
OSExchangeData data2(CloneProvider(data));
- BookmarkDragData read_data;
+ BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
ASSERT_EQ(1, read_data.elements.size());
@@ -113,7 +113,7 @@ TEST_F(BookmarkDragDataTest, URL) {
}
// Tests writing a group to the clipboard.
-TEST_F(BookmarkDragDataTest, Group) {
+TEST_F(BookmarkNodeDataTest, Group) {
TestingProfile profile;
profile.CreateBookmarkModel(false);
profile.BlockUntilBookmarkModelLoaded();
@@ -124,7 +124,7 @@ TEST_F(BookmarkDragDataTest, Group) {
const BookmarkNode* g11 = model->AddGroup(g1, 0, ASCIIToUTF16("g11"));
const BookmarkNode* g12 = model->AddGroup(g1, 0, ASCIIToUTF16("g12"));
- BookmarkDragData drag_data(g12);
+ BookmarkNodeData drag_data(g12);
EXPECT_TRUE(drag_data.is_valid());
ASSERT_EQ(1, drag_data.elements.size());
EXPECT_EQ(g12->GetTitle(), WideToUTF16Hack(drag_data.elements[0].title));
@@ -135,7 +135,7 @@ TEST_F(BookmarkDragDataTest, Group) {
// Now read the data back in.
OSExchangeData data2(CloneProvider(data));
- BookmarkDragData read_data;
+ BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
ASSERT_EQ(1, read_data.elements.size());
@@ -152,7 +152,7 @@ TEST_F(BookmarkDragDataTest, Group) {
}
// Tests reading/writing a folder with children.
-TEST_F(BookmarkDragDataTest, GroupWithChild) {
+TEST_F(BookmarkNodeDataTest, GroupWithChild) {
TestingProfile profile;
profile.SetID(L"id");
profile.CreateBookmarkModel(false);
@@ -166,18 +166,18 @@ TEST_F(BookmarkDragDataTest, GroupWithChild) {
model->AddURL(group, 0, title, url);
- BookmarkDragData drag_data(group);
+ BookmarkNodeData drag_data(group);
OSExchangeData data;
drag_data.Write(&profile, &data);
// Now read the data back in.
OSExchangeData data2(CloneProvider(data));
- BookmarkDragData read_data;
+ BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
ASSERT_EQ(1, read_data.elements.size());
ASSERT_EQ(1, read_data.elements[0].children.size());
- const BookmarkDragData::Element& read_child =
+ const BookmarkNodeData::Element& read_child =
read_data.elements[0].children[0];
EXPECT_TRUE(read_child.is_url);
@@ -191,7 +191,7 @@ TEST_F(BookmarkDragDataTest, GroupWithChild) {
}
// Tests reading/writing of multiple nodes.
-TEST_F(BookmarkDragDataTest, MultipleNodes) {
+TEST_F(BookmarkNodeDataTest, MultipleNodes) {
TestingProfile profile;
profile.SetID(L"id");
profile.CreateBookmarkModel(false);
@@ -209,24 +209,24 @@ TEST_F(BookmarkDragDataTest, MultipleNodes) {
std::vector<const BookmarkNode*> nodes;
nodes.push_back(group);
nodes.push_back(url_node);
- BookmarkDragData drag_data(nodes);
+ BookmarkNodeData drag_data(nodes);
OSExchangeData data;
drag_data.Write(&profile, &data);
// Read the data back in.
OSExchangeData data2(CloneProvider(data));
- BookmarkDragData read_data;
+ BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
ASSERT_EQ(2, read_data.elements.size());
ASSERT_EQ(1, read_data.elements[0].children.size());
- const BookmarkDragData::Element& read_group = read_data.elements[0];
+ const BookmarkNodeData::Element& read_group = read_data.elements[0];
EXPECT_FALSE(read_group.is_url);
EXPECT_EQ(L"g1", read_group.title);
EXPECT_EQ(1, read_group.children.size());
- const BookmarkDragData::Element& read_url = read_data.elements[1];
+ const BookmarkNodeData::Element& read_url = read_data.elements[1];
EXPECT_TRUE(read_url.is_url);
EXPECT_EQ(title, WideToUTF16Hack(read_url.title));
EXPECT_EQ(0, read_url.children.size());
diff --git a/chrome/browser/bookmarks/bookmark_drop_info.h b/chrome/browser/bookmarks/bookmark_drop_info.h
index c325244..1faea29 100644
--- a/chrome/browser/bookmarks/bookmark_drop_info.h
+++ b/chrome/browser/bookmarks/bookmark_drop_info.h
@@ -8,7 +8,7 @@
#include "base/basictypes.h"
#include "base/timer.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "gfx/native_widget_types.h"
namespace views {
diff --git a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h
index 6df2486..4ffc008 100644
--- a/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h
+++ b/chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h
@@ -7,7 +7,7 @@
#pragma once
#include "base/file_path.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "gfx/native_widget_types.h"
// This set of functions lets C++ code interact with the cocoa pasteboard
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index d93e3ed..fccbbb9 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -13,7 +13,7 @@
#include "base/string16.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#if defined(OS_MACOSX)
#include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h
index cab325f..0fc7615 100644
--- a/chrome/browser/bookmarks/bookmark_utils.h
+++ b/chrome/browser/bookmarks/bookmark_utils.h
@@ -10,7 +10,7 @@
#include <vector>
#include "base/string16.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_editor.h"
#include "chrome/browser/history/snippet.h"
#include "gfx/native_widget_types.h"
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmarks/bookmark_bar_controller.mm
index 33e61c2..3ba0fc9 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -2142,7 +2142,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
- (BOOL)dragBookmarkData:(id<NSDraggingInfo>)info {
BOOL dragged = NO;
- std::vector<const BookmarkNode*> nodes([self retrieveBookmarkDragDataNodes]);
+ std::vector<const BookmarkNode*> nodes([self retrieveBookmarkNodeData]);
if (nodes.size()) {
BOOL copy = !([info draggingSourceOperationMask] & NSDragOperationMove);
NSPoint dropPoint = [info draggingLocation];
@@ -2155,9 +2155,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
return dragged;
}
-- (std::vector<const BookmarkNode*>)retrieveBookmarkDragDataNodes {
+- (std::vector<const BookmarkNode*>)retrieveBookmarkNodeData {
std::vector<const BookmarkNode*> dragDataNodes;
- BookmarkDragData dragData;
+ BookmarkNodeData dragData;
if(dragData.ReadFromDragClipboard()) {
BookmarkModel* bookmarkModel = [self bookmarkModel];
Profile* profile = bookmarkModel->profile();
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
index 9abdb0a..2d72804 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmarks/bookmark_bar_controller_unittest.mm
@@ -160,7 +160,7 @@
dragDataNode_ = node;
}
-- (std::vector<const BookmarkNode*>)retrieveBookmarkDragDataNodes {
+- (std::vector<const BookmarkNode*>)retrieveBookmarkNodeData {
std::vector<const BookmarkNode*> dragDataNodes;
if(dragDataNode_) {
dragDataNodes.push_back(dragDataNode_);
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller.mm
index 6eaca1a..55fa2d0 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller.mm
@@ -1137,7 +1137,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// http://crbug.com/35966
- (BOOL)dragBookmarkData:(id<NSDraggingInfo>)info {
BOOL dragged = NO;
- std::vector<const BookmarkNode*> nodes([self retrieveBookmarkDragDataNodes]);
+ std::vector<const BookmarkNode*> nodes([self retrieveBookmarkNodeData]);
if (nodes.size()) {
BOOL copy = !([info draggingSourceOperationMask] & NSDragOperationMove);
NSPoint dropPoint = [info draggingLocation];
@@ -1152,9 +1152,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// TODO(mrossetti,jrg): Identical to the same function in BookmarkBarController.
// http://crbug.com/35966
-- (std::vector<const BookmarkNode*>)retrieveBookmarkDragDataNodes {
+- (std::vector<const BookmarkNode*>)retrieveBookmarkNodeData {
std::vector<const BookmarkNode*> dragDataNodes;
- BookmarkDragData dragData;
+ BookmarkNodeData dragData;
if(dragData.ReadFromDragClipboard()) {
BookmarkModel* bookmarkModel = [self bookmarkModel];
Profile* profile = bookmarkModel->profile();
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
index ee9ccb8..890c0fc 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmarks/bookmark_bar_folder_controller_unittest.mm
@@ -1299,7 +1299,7 @@ TEST_F(BookmarkBarFolderControllerMenuTest, HoverThenDeleteBookmark) {
dragDataNode_ = node;
}
-- (std::vector<const BookmarkNode*>)retrieveBookmarkDragDataNodes {
+- (std::vector<const BookmarkNode*>)retrieveBookmarkNodeData {
std::vector<const BookmarkNode*> dragDataNodes;
if(dragDataNode_) {
dragDataNodes.push_back(dragDataNode_);
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_button.h b/chrome/browser/cocoa/bookmarks/bookmark_button.h
index 56d9bc1..5d8574c 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_button.h
+++ b/chrome/browser/cocoa/bookmarks/bookmark_button.h
@@ -9,7 +9,7 @@
@class BookmarkBarFolderController;
@class BookmarkButton;
-struct BookmarkDragData;
+struct BookmarkNodeData;
class BookmarkModel;
class BookmarkNode;
@class BrowserWindowController;
@@ -97,7 +97,7 @@ class ThemeProvider;
// Determine if the drag pasteboard has any drag data of type
// kBookmarkDictionaryListPboardType and, if so, return those elements
// otherwise return an empty vector.
-- (std::vector<const BookmarkNode*>)retrieveBookmarkDragDataNodes;
+- (std::vector<const BookmarkNode*>)retrieveBookmarkNodeData;
// Return YES if we should show the drop indicator, else NO. In some
// cases (e.g. hover open) we don't want to show the drop indicator.
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_drag_source.h b/chrome/browser/cocoa/bookmarks/bookmark_drag_source.h
index fde2086..5c33797 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_drag_source.h
+++ b/chrome/browser/cocoa/bookmarks/bookmark_drag_source.h
@@ -4,7 +4,7 @@
#import <Cocoa/Cocoa.h>
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/cocoa/web_contents_drag_source.h"
// A class that handles tracking and event processing for a drag and drop
@@ -12,7 +12,7 @@
@interface BookmarkDragSource : WebContentsDragSource {
@private
// Our drop data. Should only be initialized once.
- std::vector<BookmarkDragData::Element> dropData_;
+ std::vector<BookmarkNodeData::Element> dropData_;
Profile* profile_;
}
@@ -22,7 +22,7 @@
// with data types appropriate for dropData.
- (id)initWithContentsView:(TabContentsViewCocoa*)contentsView
dropData:
- (const std::vector<BookmarkDragData::Element>&)dropData
+ (const std::vector<BookmarkNodeData::Element>&)dropData
profile:(Profile*)profile
pasteboard:(NSPasteboard*)pboard
dragOperationMask:(NSDragOperation)dragOperationMask;
diff --git a/chrome/browser/cocoa/bookmarks/bookmark_drag_source.mm b/chrome/browser/cocoa/bookmarks/bookmark_drag_source.mm
index f6c024c..64f9de2 100644
--- a/chrome/browser/cocoa/bookmarks/bookmark_drag_source.mm
+++ b/chrome/browser/cocoa/bookmarks/bookmark_drag_source.mm
@@ -12,7 +12,7 @@
- (id)initWithContentsView:(TabContentsViewCocoa*)contentsView
dropData:
- (const std::vector<BookmarkDragData::Element>&)dropData
+ (const std::vector<BookmarkNodeData::Element>&)dropData
profile:(Profile*)profile
pasteboard:(NSPasteboard*)pboard
dragOperationMask:(NSDragOperation)dragOperationMask {
diff --git a/chrome/browser/cocoa/web_contents_drag_source.h b/chrome/browser/cocoa/web_contents_drag_source.h
index 168ce31..1b8baaa 100644
--- a/chrome/browser/cocoa/web_contents_drag_source.h
+++ b/chrome/browser/cocoa/web_contents_drag_source.h
@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
#include "base/scoped_nsobject.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
@class TabContentsViewCocoa;
diff --git a/chrome/browser/cocoa/web_drop_target.mm b/chrome/browser/cocoa/web_drop_target.mm
index 915990a..fdc8bcc 100644
--- a/chrome/browser/cocoa/web_drop_target.mm
+++ b/chrome/browser/cocoa/web_drop_target.mm
@@ -5,7 +5,7 @@
#import "chrome/browser/cocoa/web_drop_target.h"
#include "base/sys_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
@@ -83,7 +83,7 @@ using WebKit::WebDragOperationsMask;
// If the tab is showing the boomark manager, send BookmarkDrag events
RenderViewHostDelegate::BookmarkDrag* dragDelegate =
tabContents_->GetBookmarkDragDelegate();
- BookmarkDragData dragData;
+ BookmarkNodeData dragData;
if(dragDelegate && dragData.ReadFromDragClipboard())
dragDelegate->OnDragEnter(dragData);
@@ -144,7 +144,7 @@ using WebKit::WebDragOperationsMask;
// If the tab is showing the boomark manager, send BookmarkDrag events
RenderViewHostDelegate::BookmarkDrag* dragDelegate =
tabContents_->GetBookmarkDragDelegate();
- BookmarkDragData dragData;
+ BookmarkNodeData dragData;
if(dragDelegate && dragData.ReadFromDragClipboard())
dragDelegate->OnDragOver(dragData);
return current_operation_;
@@ -174,7 +174,7 @@ using WebKit::WebDragOperationsMask;
// If the tab is showing the boomark manager, send BookmarkDrag events
RenderViewHostDelegate::BookmarkDrag* dragDelegate =
tabContents_->GetBookmarkDragDelegate();
- BookmarkDragData dragData;
+ BookmarkNodeData dragData;
if(dragDelegate && dragData.ReadFromDragClipboard())
dragDelegate->OnDrop(dragData);
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.cc b/chrome/browser/extensions/extension_bookmark_manager_api.cc
index 1b17384..cc38ad1 100644
--- a/chrome/browser/extensions/extension_bookmark_manager_api.cc
+++ b/chrome/browser/extensions/extension_bookmark_manager_api.cc
@@ -10,7 +10,7 @@
#include "base/json/json_writer.h"
#include "base/string_number_conversions.h"
#include "base/values.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
@@ -69,7 +69,7 @@ bool GetNodesFromArguments(BookmarkModel* model, const ListValue* args,
return true;
}
-// Recursively adds a node to a list. This is by used |BookmarkDragDataToJSON|
+// Recursively adds a node to a list. This is by used |BookmarkNodeDataToJSON|
// when the data comes from the current profile. In this case we have a
// BookmarkNode since we got the data from the current profile.
void AddNodeToList(ListValue* list, const BookmarkNode& node) {
@@ -96,11 +96,11 @@ void AddNodeToList(ListValue* list, const BookmarkNode& node) {
list->Append(dict);
}
-// Recursively adds an element to a list. This is by used
-// |BookmarkDragDataToJSON| when the data comes from a different profile. When
+// Recursively adds an element to a list. This is used by
+// |BookmarkNodeDataToJSON| when the data comes from a different profile. When
// the data comes from a different profile we do not have any IDs or parent IDs.
void AddElementToList(ListValue* list,
- const BookmarkDragData::Element& element) {
+ const BookmarkNodeData::Element& element) {
DictionaryValue* dict = new DictionaryValue();
if (element.is_url)
@@ -117,7 +117,7 @@ void AddElementToList(ListValue* list,
}
// Builds the JSON structure based on the BookmarksDragData.
-void BookmarkDragDataToJSON(Profile* profile, const BookmarkDragData& data,
+void BookmarkNodeDataToJSON(Profile* profile, const BookmarkNodeData& data,
ListValue* args) {
bool same_profile = data.IsFromProfile(profile);
DictionaryValue* value = new DictionaryValue();
@@ -130,7 +130,7 @@ void BookmarkDragDataToJSON(Profile* profile, const BookmarkDragData& data,
AddNodeToList(list, *nodes[i]);
} else {
// We do not have an node IDs when the data comes from a different profile.
- std::vector<BookmarkDragData::Element> elements = data.elements;
+ std::vector<BookmarkNodeData::Element> elements = data.elements;
for (size_t i = 0; i < elements.size(); ++i)
AddElementToList(list, elements[i]);
}
@@ -165,48 +165,48 @@ void ExtensionBookmarkManagerEventRouter::DispatchEvent(const char* event_name,
}
void ExtensionBookmarkManagerEventRouter::DispatchDragEvent(
- const BookmarkDragData& data, const char* event_name) {
+ const BookmarkNodeData& data, const char* event_name) {
if (data.size() == 0)
return;
ListValue args;
- BookmarkDragDataToJSON(profile_, data, &args);
+ BookmarkNodeDataToJSON(profile_, data, &args);
DispatchEvent(event_name, &args);
}
void ExtensionBookmarkManagerEventRouter::OnDragEnter(
- const BookmarkDragData& data) {
+ const BookmarkNodeData& data) {
DispatchDragEvent(data, keys::kOnBookmarkDragEnter);
}
void ExtensionBookmarkManagerEventRouter::OnDragOver(
- const BookmarkDragData& data) {
+ const BookmarkNodeData& data) {
// Intentionally empty since these events happens too often and floods the
// message queue. We do not need this event for the bookmark manager anyway.
}
void ExtensionBookmarkManagerEventRouter::OnDragLeave(
- const BookmarkDragData& data) {
+ const BookmarkNodeData& data) {
DispatchDragEvent(data, keys::kOnBookmarkDragLeave);
}
void ExtensionBookmarkManagerEventRouter::OnDrop(
- const BookmarkDragData& data) {
+ const BookmarkNodeData& data) {
DispatchDragEvent(data, keys::kOnBookmarkDrop);
// Make a copy that is owned by this instance.
- ClearBookmarkDragData();
+ ClearBookmarkNodeData();
bookmark_drag_data_ = data;
}
-const BookmarkDragData*
-ExtensionBookmarkManagerEventRouter::GetBookmarkDragData() {
+const BookmarkNodeData*
+ExtensionBookmarkManagerEventRouter::GetBookmarkNodeData() {
if (bookmark_drag_data_.is_valid())
return &bookmark_drag_data_;
return NULL;
}
-void ExtensionBookmarkManagerEventRouter::ClearBookmarkDragData() {
+void ExtensionBookmarkManagerEventRouter::ClearBookmarkNodeData() {
bookmark_drag_data_.Clear();
}
@@ -388,7 +388,7 @@ bool DropBookmarkManagerFunction::RunImpl() {
dom_ui->extension_bookmark_manager_event_router();
DCHECK(router);
- const BookmarkDragData* drag_data = router->GetBookmarkDragData();
+ const BookmarkNodeData* drag_data = router->GetBookmarkNodeData();
if (drag_data == NULL) {
NOTREACHED() <<"Somehow we're dropping null bookmark data";
return false;
@@ -397,7 +397,7 @@ bool DropBookmarkManagerFunction::RunImpl() {
*drag_data,
drop_parent, drop_index);
- router->ClearBookmarkDragData();
+ router->ClearBookmarkNodeData();
SendResponse(true);
return true;
} else {
diff --git a/chrome/browser/extensions/extension_bookmark_manager_api.h b/chrome/browser/extensions/extension_bookmark_manager_api.h
index c129bd3..3400e7e 100644
--- a/chrome/browser/extensions/extension_bookmark_manager_api.h
+++ b/chrome/browser/extensions/extension_bookmark_manager_api.h
@@ -6,12 +6,12 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_BOOKMARK_MANAGER_API_H_
#pragma once
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/extensions/extension_bookmarks_module.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/renderer_host/render_view_host_delegate.h"
-struct BookmarkDragData;
+struct BookmarkNodeData;
class ListValue;
class Profile;
class TabContents;
@@ -25,27 +25,27 @@ class ExtensionBookmarkManagerEventRouter
virtual ~ExtensionBookmarkManagerEventRouter();
// RenderViewHostDelegate::BookmarkDrag interface
- virtual void OnDragEnter(const BookmarkDragData& data);
- virtual void OnDragOver(const BookmarkDragData& data);
- virtual void OnDragLeave(const BookmarkDragData& data);
- virtual void OnDrop(const BookmarkDragData& data);
+ virtual void OnDragEnter(const BookmarkNodeData& data);
+ virtual void OnDragOver(const BookmarkNodeData& data);
+ virtual void OnDragLeave(const BookmarkNodeData& data);
+ virtual void OnDrop(const BookmarkNodeData& data);
// The bookmark drag and drop data. This gets set after a drop was done on
// the page. This returns NULL if no data is available.
- const BookmarkDragData* GetBookmarkDragData();
+ const BookmarkNodeData* GetBookmarkNodeData();
// Clears the drag and drop data.
- void ClearBookmarkDragData();
+ void ClearBookmarkNodeData();
private:
// Helper to actually dispatch an event to extension listeners.
void DispatchEvent(const char* event_name, const ListValue* args);
- void DispatchDragEvent(const BookmarkDragData& data, const char* event_name);
+ void DispatchDragEvent(const BookmarkNodeData& data, const char* event_name);
Profile* profile_;
TabContents* tab_contents_;
- BookmarkDragData bookmark_drag_data_;
+ BookmarkNodeData bookmark_drag_data_;
DISALLOW_COPY_AND_ASSIGN(ExtensionBookmarkManagerEventRouter);
};
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 26f73a9..362dbd6 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -10,7 +10,7 @@
#include "app/slide_animation.h"
#include "app/resource_bundle.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/browser_shutdown.h"
diff --git a/chrome/browser/gtk/bookmark_utils_gtk.cc b/chrome/browser/gtk/bookmark_utils_gtk.cc
index db7aa98..fa7505c 100644
--- a/chrome/browser/gtk/bookmark_utils_gtk.cc
+++ b/chrome/browser/gtk/bookmark_utils_gtk.cc
@@ -11,7 +11,7 @@
#include "base/string16.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/gtk/gtk_chrome_button.h"
@@ -320,7 +320,7 @@ void WriteBookmarksToSelection(const std::vector<const BookmarkNode*>& nodes,
Profile* profile) {
switch (target_type) {
case gtk_dnd_util::CHROME_BOOKMARK_ITEM: {
- BookmarkDragData data(nodes);
+ BookmarkNodeData data(nodes);
Pickle pickle;
data.WriteToPickle(profile, &pickle);
@@ -392,7 +392,7 @@ std::vector<const BookmarkNode*> GetNodesFromSelection(
*dnd_success = TRUE;
Pickle pickle(reinterpret_cast<char*>(selection_data->data),
selection_data->length);
- BookmarkDragData drag_data;
+ BookmarkNodeData drag_data;
drag_data.ReadFromPickle(&pickle);
return drag_data.GetNodes(profile);
}
diff --git a/chrome/browser/renderer_host/render_view_host_delegate.h b/chrome/browser/renderer_host/render_view_host_delegate.h
index a569480..b49002b 100644
--- a/chrome/browser/renderer_host/render_view_host_delegate.h
+++ b/chrome/browser/renderer_host/render_view_host_delegate.h
@@ -25,7 +25,7 @@
class AutomationResourceRoutingDelegate;
class BackgroundContents;
-struct BookmarkDragData;
+struct BookmarkNodeData;
class BookmarkNode;
struct ContextMenuParams;
class FilePath;
@@ -585,10 +585,10 @@ class RenderViewHostDelegate {
class BookmarkDrag {
public:
- virtual void OnDragEnter(const BookmarkDragData& data) = 0;
- virtual void OnDragOver(const BookmarkDragData& data) = 0;
- virtual void OnDragLeave(const BookmarkDragData& data) = 0;
- virtual void OnDrop(const BookmarkDragData& data) = 0;
+ virtual void OnDragEnter(const BookmarkNodeData& data) = 0;
+ virtual void OnDragOver(const BookmarkNodeData& data) = 0;
+ virtual void OnDragLeave(const BookmarkNodeData& data) = 0;
+ virtual void OnDrop(const BookmarkNodeData& data) = 0;
protected:
virtual ~BookmarkDrag() {}
diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.cc b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
index 2c38987..eaede71 100644
--- a/chrome/browser/tab_contents/web_drag_dest_gtk.cc
+++ b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
@@ -9,7 +9,7 @@
#include "app/gtk_dnd_util.h"
#include "base/file_path.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/gtk/bookmark_utils_gtk.h"
#include "chrome/browser/gtk/gtk_util.h"
#include "chrome/browser/renderer_host/render_view_host.h"
@@ -28,11 +28,11 @@ namespace {
// gtk_dnd_util::CHROME_BOOKMARK_ITEM. See
// bookmark_utils::WriteBookmarksToSelection() for details.
// For Views, bookmark drag data is encoded in the same format, and
-// associated with a custom format. See BookmarkDragData::Write() for
+// associated with a custom format. See BookmarkNodeData::Write() for
// details.
GdkAtom GetBookmarkTargetAtom() {
#if defined(TOOLKIT_VIEWS)
- return BookmarkDragData::GetBookmarkCustomFormat();
+ return BookmarkNodeData::GetBookmarkCustomFormat();
#else
return gtk_dnd_util::GetAtomForTarget(gtk_dnd_util::CHROME_BOOKMARK_ITEM);
#endif
diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.h b/chrome/browser/tab_contents/web_drag_dest_gtk.h
index 67d6852..4b85f9f 100644
--- a/chrome/browser/tab_contents/web_drag_dest_gtk.h
+++ b/chrome/browser/tab_contents/web_drag_dest_gtk.h
@@ -11,7 +11,7 @@
#include "app/gtk_signal.h"
#include "base/scoped_ptr.h"
#include "base/task.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDragOperation.h"
#include "webkit/glue/webdropdata.h"
@@ -84,7 +84,7 @@ class WebDragDestGtk {
// The bookmark data for the current tab. This will be empty if there is not
// a native bookmark drag (or we haven't gotten the data from the source yet).
- BookmarkDragData bookmark_drag_data_;
+ BookmarkNodeData bookmark_drag_data_;
ScopedRunnableMethodFactory<WebDragDestGtk> method_factory_;
diff --git a/chrome/browser/tab_contents/web_drop_target_win.cc b/chrome/browser/tab_contents/web_drop_target_win.cc
index e626181..d70b851 100644
--- a/chrome/browser/tab_contents/web_drop_target_win.cc
+++ b/chrome/browser/tab_contents/web_drop_target_win.cc
@@ -10,7 +10,7 @@
#include "app/clipboard/clipboard_util_win.h"
#include "app/os_exchange_data.h"
#include "app/os_exchange_data_provider_win.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/web_drag_utils_win.h"
@@ -125,7 +125,7 @@ DWORD WebDropTarget::OnDragEnter(IDataObject* data_object,
// support for (at the moment experimental) drag and drop extensions.
if (tab_contents_->GetBookmarkDragDelegate()) {
OSExchangeData os_exchange_data(new OSExchangeDataProviderWin(data_object));
- BookmarkDragData bookmark_drag_data;
+ BookmarkNodeData bookmark_drag_data;
if (bookmark_drag_data.Read(os_exchange_data))
tab_contents_->GetBookmarkDragDelegate()->OnDragEnter(bookmark_drag_data);
}
@@ -155,7 +155,7 @@ DWORD WebDropTarget::OnDragOver(IDataObject* data_object,
if (tab_contents_->GetBookmarkDragDelegate()) {
OSExchangeData os_exchange_data(new OSExchangeDataProviderWin(data_object));
- BookmarkDragData bookmark_drag_data;
+ BookmarkNodeData bookmark_drag_data;
if (bookmark_drag_data.Read(os_exchange_data))
tab_contents_->GetBookmarkDragDelegate()->OnDragOver(bookmark_drag_data);
}
@@ -176,7 +176,7 @@ void WebDropTarget::OnDragLeave(IDataObject* data_object) {
if (tab_contents_->GetBookmarkDragDelegate()) {
OSExchangeData os_exchange_data(new OSExchangeDataProviderWin(data_object));
- BookmarkDragData bookmark_drag_data;
+ BookmarkNodeData bookmark_drag_data;
if (bookmark_drag_data.Read(os_exchange_data))
tab_contents_->GetBookmarkDragDelegate()->OnDragLeave(bookmark_drag_data);
}
@@ -204,7 +204,7 @@ DWORD WebDropTarget::OnDrop(IDataObject* data_object,
if (tab_contents_->GetBookmarkDragDelegate()) {
OSExchangeData os_exchange_data(new OSExchangeDataProviderWin(data_object));
- BookmarkDragData bookmark_drag_data;
+ BookmarkNodeData bookmark_drag_data;
if (bookmark_drag_data.Read(os_exchange_data))
tab_contents_->GetBookmarkDragDelegate()->OnDrop(bookmark_drag_data);
}
diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc
index 6226524..be90191 100644
--- a/chrome/browser/ui/views/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmark_bar_view.cc
@@ -318,7 +318,7 @@ struct BookmarkBarView::DropInfo {
int drag_operation;
// DropData for the drop.
- BookmarkDragData data;
+ BookmarkNodeData data;
};
// ButtonSeparatorView --------------------------------------------------------
@@ -568,7 +568,7 @@ bool BookmarkBarView::GetDropFormats(
if (!model_ || !model_->IsLoaded())
return false;
*formats = OSExchangeData::URL;
- custom_formats->insert(BookmarkDragData::GetBookmarkCustomFormat());
+ custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat());
return true;
}
@@ -682,7 +682,7 @@ int BookmarkBarView::OnPerformDrop(const DropTargetEvent& event) {
model_->GetBookmarkBarNode();
int index = drop_info_->drop_index;
const bool drop_on = drop_info_->drop_on;
- const BookmarkDragData data = drop_info_->data;
+ const BookmarkNodeData data = drop_info_->data;
const bool is_over_other = drop_info_->is_over_other;
DCHECK(data.is_valid());
@@ -1173,7 +1173,7 @@ bool BookmarkBarView::CanStartDrag(views::View* sender,
void BookmarkBarView::WriteDragData(const BookmarkNode* node,
OSExchangeData* data) {
DCHECK(node && data);
- BookmarkDragData drag_data(node);
+ BookmarkNodeData drag_data(node);
drag_data.Write(profile_, data);
}
@@ -1401,7 +1401,7 @@ void BookmarkBarView::StartShowFolderDropMenuTimer(const BookmarkNode* node) {
}
int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event,
- const BookmarkDragData& data,
+ const BookmarkNodeData& data,
int* index,
bool* drop_on,
bool* is_over_overflow,
diff --git a/chrome/browser/ui/views/bookmark_bar_view.h b/chrome/browser/ui/views/bookmark_bar_view.h
index a70a03d..9fadd8b 100644
--- a/chrome/browser/ui/views/bookmark_bar_view.h
+++ b/chrome/browser/ui/views/bookmark_bar_view.h
@@ -9,7 +9,7 @@
#include <set>
#include "app/animation_delegate.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "chrome/browser/sync/profile_sync_service.h"
#include "chrome/browser/views/bookmark_bar_instructions_view.h"
@@ -352,7 +352,7 @@ class BookmarkBarView : public DetachableToolbarView,
const gfx::Point& press_pt,
const gfx::Point& p);
- // Writes a BookmarkDragData for node to data.
+ // Writes a BookmarkNodeData for node to data.
void WriteDragData(const BookmarkNode* node, OSExchangeData* data);
// ViewMenuDelegate method. Ends up creating a BookmarkMenuController to
@@ -408,7 +408,7 @@ class BookmarkBarView : public DetachableToolbarView,
// Returns the drop operation and index for the drop based on the event
// and data. Returns DragDropTypes::DRAG_NONE if not a valid location.
int CalculateDropOperation(const views::DropTargetEvent& event,
- const BookmarkDragData& data,
+ const BookmarkNodeData& data,
int* index,
bool* drop_on,
bool* is_over_overflow,
diff --git a/chrome/browser/ui/views/bookmark_menu_controller_views.cc b/chrome/browser/ui/views/bookmark_menu_controller_views.cc
index c86432e..de89264 100644
--- a/chrome/browser/ui/views/bookmark_menu_controller_views.cc
+++ b/chrome/browser/ui/views/bookmark_menu_controller_views.cc
@@ -8,7 +8,7 @@
#include "app/resource_bundle.h"
#include "base/stl_util-inl.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/metrics/user_metrics.h"
@@ -109,7 +109,7 @@ bool BookmarkMenuController::GetDropFormats(
int* formats,
std::set<OSExchangeData::CustomFormat>* custom_formats) {
*formats = OSExchangeData::URL;
- custom_formats->insert(BookmarkDragData::GetBookmarkCustomFormat());
+ custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat());
return true;
}
@@ -224,7 +224,7 @@ void BookmarkMenuController::WriteDragData(MenuItemView* sender,
UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragFromFolder"),
profile_);
- BookmarkDragData drag_data(menu_id_to_node_map_[sender->GetCommand()]);
+ BookmarkNodeData drag_data(menu_id_to_node_map_[sender->GetCommand()]);
drag_data.Write(profile_, data);
}
diff --git a/chrome/browser/ui/views/bookmark_menu_controller_views.h b/chrome/browser/ui/views/bookmark_menu_controller_views.h
index 68752bd..3d4f013 100644
--- a/chrome/browser/ui/views/bookmark_menu_controller_views.h
+++ b/chrome/browser/ui/views/bookmark_menu_controller_views.h
@@ -10,7 +10,7 @@
#include <set>
#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/views/bookmark_context_menu.h"
#include "gfx/native_widget_types.h"
#include "views/controls/menu/menu_delegate.h"
@@ -173,7 +173,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
views::MenuItemView* menu_;
// Data for the drop.
- BookmarkDragData drop_data_;
+ BookmarkNodeData drop_data_;
// Used when a context menu is shown.
scoped_ptr<BookmarkContextMenu> context_menu_;
diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
index 51d8f3a..bc31aac 100644
--- a/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
+++ b/chrome/browser/ui/views/tab_contents/tab_contents_drag_win.cc
@@ -13,7 +13,7 @@
#include "base/task.h"
#include "base/thread.h"
#include "base/utf_string_conversions.h"
-#include "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "chrome/browser/bookmarks/bookmark_node_data.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/download/drag_download_file.h"
@@ -247,14 +247,14 @@ void TabContentsDragWin::PrepareDragForUrl(const WebDropData& drop_data,
if (drop_data.url.SchemeIs(chrome::kJavaScriptScheme)) {
// We don't want to allow javascript URLs to be dragged to the desktop,
// but we do want to allow them to be added to the bookmarks bar
- // (bookmarklets). So we create a fake bookmark entry (BookmarkDragData
+ // (bookmarklets). So we create a fake bookmark entry (BookmarkNodeData
// object) which explorer.exe cannot handle, and write the entry to data.
- BookmarkDragData::Element bm_elt;
+ BookmarkNodeData::Element bm_elt;
bm_elt.is_url = true;
bm_elt.url = drop_data.url;
bm_elt.title = drop_data.url_title;
- BookmarkDragData bm_drag_data;
+ BookmarkNodeData bm_drag_data;
bm_drag_data.elements.push_back(bm_elt);
// Pass in NULL as the profile so that the bookmark always adds the url