summaryrefslogtreecommitdiffstats
path: root/chrome/browser/bookmarks
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 19:00:48 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-12 19:00:48 +0000
commit41d2e4af3daa1d1ca8f8cbfa6788604a4c9913b9 (patch)
treefa82bb18c231744e72ffd334217be1e256c9e849 /chrome/browser/bookmarks
parent356a50ef463bb52fdd9d5700ca11b4b83d4809bc (diff)
downloadchromium_src-41d2e4af3daa1d1ca8f8cbfa6788604a4c9913b9.zip
chromium_src-41d2e4af3daa1d1ca8f8cbfa6788604a4c9913b9.tar.gz
chromium_src-41d2e4af3daa1d1ca8f8cbfa6788604a4c9913b9.tar.bz2
Move OSExchangeData from src/app to src/ui/base/dragdrop
BUG=none TEST=none TBR=brettw Review URL: http://codereview.chromium.org/6200005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71205 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/bookmarks')
-rw-r--r--chrome/browser/bookmarks/bookmark_node_data.cc10
-rw-r--r--chrome/browser/bookmarks/bookmark_node_data.h8
-rw-r--r--chrome/browser/bookmarks/bookmark_node_data_unittest.cc36
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc4
4 files changed, 29 insertions, 29 deletions
diff --git a/chrome/browser/bookmarks/bookmark_node_data.cc b/chrome/browser/bookmarks/bookmark_node_data.cc
index e51c17c..c94d207 100644
--- a/chrome/browser/bookmarks/bookmark_node_data.cc
+++ b/chrome/browser/bookmarks/bookmark_node_data.cc
@@ -81,13 +81,13 @@ bool BookmarkNodeData::Element::ReadFromPickle(Pickle* pickle,
#if defined(TOOLKIT_VIEWS)
// static
-OSExchangeData::CustomFormat BookmarkNodeData::GetBookmarkCustomFormat() {
- static OSExchangeData::CustomFormat format;
+ui::OSExchangeData::CustomFormat BookmarkNodeData::GetBookmarkCustomFormat() {
+ static ui::OSExchangeData::CustomFormat format;
static bool format_valid = false;
if (!format_valid) {
format_valid = true;
- format = OSExchangeData::RegisterCustomFormat(
+ format = ui::OSExchangeData::RegisterCustomFormat(
BookmarkNodeData::kClipboardFormatString);
}
return format;
@@ -217,7 +217,7 @@ bool BookmarkNodeData::ClipboardContainsBookmarks() {
#endif // !defined(OS_MACOSX)
#if defined(TOOLKIT_VIEWS)
-void BookmarkNodeData::Write(Profile* profile, OSExchangeData* data) const {
+void BookmarkNodeData::Write(Profile* profile, ui::OSExchangeData* data) const {
DCHECK(data);
// If there is only one element and it is a URL, write the URL to the
@@ -236,7 +236,7 @@ void BookmarkNodeData::Write(Profile* profile, OSExchangeData* data) const {
data->SetPickledData(GetBookmarkCustomFormat(), data_pickle);
}
-bool BookmarkNodeData::Read(const OSExchangeData& data) {
+bool BookmarkNodeData::Read(const ui::OSExchangeData& data) {
elements.clear();
profile_path_.clear();
diff --git a/chrome/browser/bookmarks/bookmark_node_data.h b/chrome/browser/bookmarks/bookmark_node_data.h
index 8b8310d..d45054d 100644
--- a/chrome/browser/bookmarks/bookmark_node_data.h
+++ b/chrome/browser/bookmarks/bookmark_node_data.h
@@ -13,7 +13,7 @@
#include "googleurl/src/gurl.h"
#if defined(TOOLKIT_VIEWS)
-#include "app/os_exchange_data.h"
+#include "ui/base/dragdrop/os_exchange_data.h"
#endif
class BookmarkNode;
@@ -74,7 +74,7 @@ struct BookmarkNodeData {
BookmarkNodeData();
#if defined(TOOLKIT_VIEWS)
- static OSExchangeData::CustomFormat GetBookmarkCustomFormat();
+ static ui::OSExchangeData::CustomFormat GetBookmarkCustomFormat();
#endif
// Created a BookmarkNodeData populated from the arguments.
@@ -108,10 +108,10 @@ struct BookmarkNodeData {
// use.
// |profile| is used to identify which profile the data came from. Use a
// value of null to indicate the data is not associated with any profile.
- void Write(Profile* profile, OSExchangeData* data) const;
+ void Write(Profile* profile, ui::OSExchangeData* data) const;
// Restores this data from the clipboard, returning true on success.
- bool Read(const OSExchangeData& data);
+ bool Read(const ui::OSExchangeData& data);
#endif
// Writes the data for a drag to |pickle|.
diff --git a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc
index a81d0a0..88f6936 100644
--- a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc
@@ -1,9 +1,7 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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 "app/os_exchange_data.h"
-#include "app/os_exchange_data_provider_win.h"
#include "base/message_loop.h"
#include "base/scoped_ptr.h"
#include "base/string16.h"
@@ -14,6 +12,8 @@
#include "chrome/test/testing_profile.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/base/dragdrop/os_exchange_data.h"
+#include "ui/base/dragdrop/os_exchange_data_provider_win.h"
class BookmarkNodeDataTest : public testing::Test {
public:
@@ -29,9 +29,9 @@ class BookmarkNodeDataTest : public testing::Test {
namespace {
-OSExchangeData::Provider* CloneProvider(const OSExchangeData& data) {
- return new OSExchangeDataProviderWin(
- OSExchangeDataProviderWin::GetIDataObject(data));
+ui::OSExchangeData::Provider* CloneProvider(const ui::OSExchangeData& data) {
+ return new ui::OSExchangeDataProviderWin(
+ ui::OSExchangeDataProviderWin::GetIDataObject(data));
}
} // namespace
@@ -44,9 +44,9 @@ TEST_F(BookmarkNodeDataTest, InitialState) {
// Makes sure reading bogus data leaves the BookmarkNodeData invalid.
TEST_F(BookmarkNodeDataTest, BogusRead) {
- OSExchangeData data;
+ ui::OSExchangeData data;
BookmarkNodeData drag_data;
- EXPECT_FALSE(drag_data.Read(OSExchangeData(CloneProvider(data))));
+ EXPECT_FALSE(drag_data.Read(ui::OSExchangeData(CloneProvider(data))));
EXPECT_FALSE(drag_data.is_valid());
}
@@ -56,11 +56,11 @@ TEST_F(BookmarkNodeDataTest, JustURL) {
const GURL url("http://google.com");
const std::wstring title(L"title");
- OSExchangeData data;
+ ui::OSExchangeData data;
data.SetURL(url, title);
BookmarkNodeData drag_data;
- EXPECT_TRUE(drag_data.Read(OSExchangeData(CloneProvider(data))));
+ EXPECT_TRUE(drag_data.Read(ui::OSExchangeData(CloneProvider(data))));
EXPECT_TRUE(drag_data.is_valid());
ASSERT_EQ(1, drag_data.elements.size());
EXPECT_TRUE(drag_data.elements[0].is_url);
@@ -86,11 +86,11 @@ TEST_F(BookmarkNodeDataTest, URL) {
EXPECT_TRUE(drag_data.elements[0].is_url);
EXPECT_EQ(url, drag_data.elements[0].url);
EXPECT_EQ(title, WideToUTF16Hack(drag_data.elements[0].title));
- OSExchangeData data;
+ ui::OSExchangeData data;
drag_data.Write(&profile, &data);
// Now read the data back in.
- OSExchangeData data2(CloneProvider(data));
+ ui::OSExchangeData data2(CloneProvider(data));
BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
@@ -130,11 +130,11 @@ TEST_F(BookmarkNodeDataTest, Group) {
EXPECT_EQ(g12->GetTitle(), WideToUTF16Hack(drag_data.elements[0].title));
EXPECT_FALSE(drag_data.elements[0].is_url);
- OSExchangeData data;
+ ui::OSExchangeData data;
drag_data.Write(&profile, &data);
// Now read the data back in.
- OSExchangeData data2(CloneProvider(data));
+ ui::OSExchangeData data2(CloneProvider(data));
BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
@@ -168,11 +168,11 @@ TEST_F(BookmarkNodeDataTest, GroupWithChild) {
BookmarkNodeData drag_data(group);
- OSExchangeData data;
+ ui::OSExchangeData data;
drag_data.Write(&profile, &data);
// Now read the data back in.
- OSExchangeData data2(CloneProvider(data));
+ ui::OSExchangeData data2(CloneProvider(data));
BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
ASSERT_EQ(1, read_data.elements.size());
@@ -210,11 +210,11 @@ TEST_F(BookmarkNodeDataTest, MultipleNodes) {
nodes.push_back(group);
nodes.push_back(url_node);
BookmarkNodeData drag_data(nodes);
- OSExchangeData data;
+ ui::OSExchangeData data;
drag_data.Write(&profile, &data);
// Read the data back in.
- OSExchangeData data2(CloneProvider(data));
+ ui::OSExchangeData data2(CloneProvider(data));
BookmarkNodeData read_data;
EXPECT_TRUE(read_data.Read(data2));
EXPECT_TRUE(read_data.is_valid());
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 55acbbe..848215a 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -38,7 +38,7 @@
#include "views/event.h"
#if defined(TOOLKIT_VIEWS)
-#include "app/os_exchange_data.h"
+#include "ui/base/dragdrop/os_exchange_data.h"
#include "views/drag_utils.h"
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
@@ -325,7 +325,7 @@ void DragBookmarks(Profile* profile,
#if defined(TOOLKIT_VIEWS)
// Set up our OLE machinery
- OSExchangeData data;
+ ui::OSExchangeData data;
BookmarkNodeData drag_data(nodes);
drag_data.Write(profile, &data);