summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-03 04:25:37 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-03 04:25:37 +0000
commit90f399075f9082bf7031512d6579ec1196dc060a (patch)
tree8d47273615d98732a60d0e77a0787d1623204a4b /chrome
parentf0f400cb2e0a3c545d723524e8bbaf136caacf81 (diff)
downloadchromium_src-90f399075f9082bf7031512d6579ec1196dc060a.zip
chromium_src-90f399075f9082bf7031512d6579ec1196dc060a.tar.gz
chromium_src-90f399075f9082bf7031512d6579ec1196dc060a.tar.bz2
Move the clipboard stuff out of base and into app/clipboard. I renamed
clipboard_util to clipboard_util_win since it's Windows-only. This patch makes test_shell depend on app as well. There should be no logic change. TEST=none BUG=none Review URL: http://codereview.chromium.org/260003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac.mm3
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm4
-rw-r--r--chrome/browser/autocomplete/autocomplete_edit_view_win.cc4
-rw-r--r--chrome/browser/bookmarks/bookmark_drag_data.cc4
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc4
-rw-r--r--chrome/browser/bookmarks/bookmark_utils_unittest.cc2
-rw-r--r--chrome/browser/browser.cc4
-rw-r--r--chrome/browser/browser_process_impl.cc2
-rw-r--r--chrome/browser/net/browser_url_util.cc29
-rw-r--r--chrome/browser/net/browser_url_util.h22
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc4
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h5
-rw-r--r--chrome/browser/renderer_host/resource_message_filter_gtk.cc4
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc10
-rw-r--r--chrome/browser/tab_contents/web_drop_target.cc4
-rw-r--r--chrome/browser/views/chrome_views_delegate.cc2
-rwxr-xr-xchrome/chrome.gyp6
-rw-r--r--chrome/common/render_messages.h4
-rw-r--r--chrome/common/render_messages_internal.h2
-rw-r--r--chrome/renderer/renderer_glue.cc6
-rw-r--r--chrome/test/testing_browser_process.h4
21 files changed, 91 insertions, 38 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
index 56fb434..6675a42 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm
@@ -5,10 +5,11 @@
#include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h"
#include <Carbon/Carbon.h> // kVK_Return
+
+#include "app/clipboard/clipboard.h"
#include "app/gfx/font.h"
#include "app/l10n_util_mac.h"
#include "app/resource_bundle.h"
-#include "base/clipboard.h"
#import "base/cocoa_protocols_mac.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm
index c57a5b4..59ce3bc 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac_unittest.mm
@@ -4,9 +4,9 @@
#import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h"
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "base/gfx/size.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/autocomplete/autocomplete.h"
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
index 5af7976..e58422c 100644
--- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
+++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc
@@ -6,6 +6,8 @@
#include <locale>
+#include "app/clipboard/clipboard.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/l10n_util_win.h"
@@ -15,12 +17,10 @@
#include "base/base_drag_source.h"
#include "base/base_drop_target.h"
#include "base/basictypes.h"
-#include "base/clipboard.h"
#include "base/iat_patch.h"
#include "base/keyboard_codes.h"
#include "base/lazy_instance.h"
#include "base/ref_counted.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/autocomplete/autocomplete_accessibility.h"
diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc
index 81a85fb..2f8e1ad 100644
--- a/chrome/browser/bookmarks/bookmark_drag_data.cc
+++ b/chrome/browser/bookmarks/bookmark_drag_data.cc
@@ -1,12 +1,12 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "chrome/browser/bookmarks/bookmark_drag_data.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "base/basictypes.h"
#include "base/pickle.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/profile.h"
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index 94fe0ff..945e22a 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -1,14 +1,14 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "chrome/browser/bookmarks/bookmark_utils.h"
+#include "app/clipboard/clipboard.h"
#include "app/drag_drop_types.h"
#include "app/l10n_util.h"
#include "app/tree_node_iterator.h"
#include "base/basictypes.h"
-#include "base/clipboard.h"
#include "base/string_util.h"
#include "base/time.h"
#include "chrome/browser/bookmarks/bookmark_drag_data.h"
diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
index b1b56a5..620c79c 100644
--- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc
+++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc
@@ -4,8 +4,8 @@
#include "testing/gtest/include/gtest/gtest.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "base/message_loop.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 1223101..c685b5e 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -9,7 +9,6 @@
#include "base/command_line.h"
#include "base/keyboard_codes.h"
#include "base/logging.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "base/thread.h"
#include "chrome/app/chrome_dll_resource.h"
@@ -34,6 +33,7 @@
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/location_bar.h"
#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/browser/net/browser_url_util.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/options_window.h"
#include "chrome/browser/profile.h"
@@ -866,7 +866,7 @@ void Browser::WriteCurrentURLToClipboard() {
if (!contents->ShouldDisplayURL())
return;
- net::WriteURLToClipboard(
+ chrome_browser_net::WriteURLToClipboard(
contents->GetURL(),
profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
g_browser_process->clipboard());
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 750dc2c..fca8950 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/browser_process_impl.h"
+#include "app/clipboard/clipboard.h"
#include "app/l10n_util.h"
-#include "base/clipboard.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
diff --git a/chrome/browser/net/browser_url_util.cc b/chrome/browser/net/browser_url_util.cc
new file mode 100644
index 0000000..7688051
--- /dev/null
+++ b/chrome/browser/net/browser_url_util.cc
@@ -0,0 +1,29 @@
+// Copyright (c) 2009 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 "chrome/browser/net/browser_url_util.h"
+
+#include "app/clipboard/scoped_clipboard_writer.h"
+#include "base/string_util.h"
+#include "googleurl/src/gurl.h"
+#include "net/base/net_util.h"
+
+namespace chrome_browser_net {
+
+void WriteURLToClipboard(const GURL& url,
+ const std::wstring& languages,
+ Clipboard *clipboard) {
+ if (url.is_empty() || !url.is_valid() || !clipboard)
+ return;
+
+ // Unescaping path and query is not a good idea because other applications
+ // may not encode non-ASCII characters in UTF-8. See crbug.com/2820.
+ string16 text = WideToUTF16(net::FormatUrl(url, languages, false,
+ UnescapeRule::NONE, NULL, NULL));
+
+ ScopedClipboardWriter scw(clipboard);
+ scw.WriteURL(text);
+}
+
+} // namespace chrome_browser_net
diff --git a/chrome/browser/net/browser_url_util.h b/chrome/browser/net/browser_url_util.h
new file mode 100644
index 0000000..955265b
--- /dev/null
+++ b/chrome/browser/net/browser_url_util.h
@@ -0,0 +1,22 @@
+// Copyright (c) 2009 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.
+
+#ifndef CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_
+#define CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_
+
+#include <string>
+
+class Clipboard;
+class GURL;
+
+namespace chrome_browser_net {
+
+// Writes a string representation of |url| to the system clipboard.
+void WriteURLToClipboard(const GURL& url,
+ const std::wstring& languages,
+ Clipboard *clipboard);
+
+} // namespace chrome_browser_net
+
+#endif // CHROME_BROWSER_NET_BROWSER_URL_UTIL_H_
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index a7d9360..622f8e5e 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -1,10 +1,10 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "chrome/browser/renderer_host/resource_message_filter.h"
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
#include "base/command_line.h"
#include "base/gfx/native_widget_types.h"
#include "base/histogram.h"
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index 97b3eb7..82bbcdc 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -12,7 +12,7 @@
#include <string>
#include <vector>
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
#include "base/file_path.h"
#include "base/gfx/rect.h"
#include "base/gfx/native_widget_types.h"
@@ -32,7 +32,6 @@
class AppCacheDispatcherHost;
class AudioRendererHost;
-class Clipboard;
class DatabaseDispatcherHost;
class DOMStorageDispatcherHost;
class ExtensionMessageService;
diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
index d6fb45e..e911edf 100644
--- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc
+++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -7,8 +7,8 @@
#include <fcntl.h>
#include <map>
+#include "app/clipboard/clipboard.h"
#include "app/l10n_util.h"
-#include "base/clipboard.h"
#include "base/file_util.h"
#include "base/gfx/gtk_native_view_id_manager.h"
#include "base/path_service.h"
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index ba62b06..1f4a6ac 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1,20 +1,21 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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 "chrome/browser/tab_contents/render_view_context_menu.h"
+#include "app/clipboard/clipboard.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "app/l10n_util.h"
-#include "base/clipboard.h"
#include "base/command_line.h"
#include "base/logging.h"
-#include "base/scoped_clipboard_writer.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_manager.h"
#include "chrome/browser/download/download_manager.h"
#include "chrome/browser/fonts_languages_window.h"
#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/browser/net/browser_url_util.h"
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/search_engines/template_url_model.h"
@@ -28,7 +29,6 @@
#include "chrome/common/url_constants.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
-#include "net/base/net_util.h"
#include "webkit/glue/media_player_action.h"
namespace {
@@ -802,7 +802,7 @@ void RenderViewContextMenu::Inspect(int x, int y) {
}
void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) {
- net::WriteURLToClipboard(
+ chrome_browser_net::WriteURLToClipboard(
url,
profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
g_browser_process->clipboard());
diff --git a/chrome/browser/tab_contents/web_drop_target.cc b/chrome/browser/tab_contents/web_drop_target.cc
index 4494c0d..259e8ba 100644
--- a/chrome/browser/tab_contents/web_drop_target.cc
+++ b/chrome/browser/tab_contents/web_drop_target.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -7,9 +7,9 @@
#include "chrome/browser/tab_contents/web_drop_target.h"
+#include "app/clipboard/clipboard_util_win.h"
#include "app/os_exchange_data.h"
#include "app/os_exchange_data_provider_win.h"
-#include "base/clipboard_util.h"
#include "base/gfx/point.h"
#include "chrome/browser/renderer_host/render_view_host.h"
#include "chrome/browser/tab_contents/tab_contents.h"
diff --git a/chrome/browser/views/chrome_views_delegate.cc b/chrome/browser/views/chrome_views_delegate.cc
index bc87e19..f7d33b9 100644
--- a/chrome/browser/views/chrome_views_delegate.cc
+++ b/chrome/browser/views/chrome_views_delegate.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/views/chrome_views_delegate.h"
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
#include "base/gfx/rect.h"
#include "base/scoped_ptr.h"
#include "chrome/app/chrome_dll_resource.h"
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 4fcec3a..c002bd7 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1642,10 +1642,10 @@
'browser/metrics/user_metrics.h',
'browser/modal_html_dialog_delegate.cc',
'browser/modal_html_dialog_delegate.h',
+ 'browser/net/browser_url_util.cc',
+ 'browser/net/browser_url_util.h',
'browser/net/chrome_url_request_context.cc',
'browser/net/chrome_url_request_context.h',
- 'browser/net/sqlite_persistent_cookie_store.cc',
- 'browser/net/sqlite_persistent_cookie_store.h',
'browser/net/dns_global.cc',
'browser/net/dns_global.h',
'browser/net/dns_host_info.cc',
@@ -1662,6 +1662,8 @@
'browser/net/resolve_proxy_msg_helper.h',
'browser/net/sdch_dictionary_fetcher.cc',
'browser/net/sdch_dictionary_fetcher.h',
+ 'browser/net/sqlite_persistent_cookie_store.cc',
+ 'browser/net/sqlite_persistent_cookie_store.h',
'browser/net/ssl_config_service_manager.h',
'browser/net/url_fetcher.cc',
'browser/net/url_fetcher.h',
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 90fd465..1dfc4b9 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -9,8 +9,8 @@
#include <vector>
#include <map>
+#include "app/clipboard/clipboard.h"
#include "base/basictypes.h"
-#include "base/clipboard.h"
#include "base/gfx/native_widget_types.h"
#include "base/ref_counted.h"
#include "base/shared_memory.h"
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index d590294..b639d0a 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -12,7 +12,7 @@
#include "build/build_config.h"
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
#include "base/file_path.h"
#include "base/nullable_string16.h"
#include "base/platform_file.h"
diff --git a/chrome/renderer/renderer_glue.cc b/chrome/renderer/renderer_glue.cc
index be06db4..ccd4989 100644
--- a/chrome/renderer/renderer_glue.cc
+++ b/chrome/renderer/renderer_glue.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -13,9 +13,9 @@
#include <wininet.h>
#endif
+#include "app/clipboard/clipboard.h"
+#include "app/clipboard/scoped_clipboard_writer.h"
#include "app/resource_bundle.h"
-#include "base/clipboard.h"
-#include "base/scoped_clipboard_writer.h"
#include "base/string_util.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/render_messages.h"
diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h
index d105fda..93444ad 100644
--- a/chrome/test/testing_browser_process.h
+++ b/chrome/test/testing_browser_process.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 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.
@@ -14,7 +14,7 @@
#include <string>
-#include "base/clipboard.h"
+#include "app/clipboard/clipboard.h"
#include "base/string_util.h"
#include "base/waitable_event.h"
#include "chrome/browser/browser_process.h"