diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 04:25:37 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-03 04:25:37 +0000 |
commit | 90f399075f9082bf7031512d6579ec1196dc060a (patch) | |
tree | 8d47273615d98732a60d0e77a0787d1623204a4b | |
parent | f0f400cb2e0a3c545d723524e8bbaf136caacf81 (diff) | |
download | chromium_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
47 files changed, 151 insertions, 122 deletions
diff --git a/app/app.gyp b/app/app.gyp index 12e3121..b008c1a 100644 --- a/app/app.gyp +++ b/app/app.gyp @@ -68,6 +68,15 @@ 'app_paths.cc', 'app_switches.h', 'app_switches.cc', + 'clipboard/clipboard.cc', + 'clipboard/clipboard.h', + 'clipboard/clipboard_linux.cc', + 'clipboard/clipboard_mac.mm', + 'clipboard/clipboard_util_win.cc', + 'clipboard/clipboard_util_win.h', + 'clipboard/clipboard_win.cc', + 'clipboard/scoped_clipboard_writer.cc', + 'clipboard/scoped_clipboard_writer.h', 'combobox_model.h', 'drag_drop_types_gtk.cc', 'drag_drop_types_win.cc', @@ -213,6 +222,7 @@ ], 'sources': [ 'animation_unittest.cc', + 'clipboard/clipboard_unittest.cc', 'gfx/codec/jpeg_codec_unittest.cc', 'gfx/codec/png_codec_unittest.cc', 'gfx/color_utils_unittest.cc', diff --git a/base/clipboard.cc b/app/clipboard/clipboard.cc index 510929e..bc91408 100644 --- a/base/clipboard.cc +++ b/app/clipboard/clipboard.cc @@ -1,8 +1,8 @@ -// 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 "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/gfx/size.h" #include "base/logging.h" diff --git a/base/clipboard.h b/app/clipboard/clipboard.h index e5cc9c2..6dd3927 100644 --- a/base/clipboard.h +++ b/app/clipboard/clipboard.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 BASE_CLIPBOARD_H_ -#define BASE_CLIPBOARD_H_ +#ifndef APP_CLIPBOARD_CLIPBOARD_H_ +#define APP_CLIPBOARD_CLIPBOARD_H_ #include <map> #include <string> @@ -256,4 +256,4 @@ class Clipboard { DISALLOW_COPY_AND_ASSIGN(Clipboard); }; -#endif // BASE_CLIPBOARD_H_ +#endif // APP_CLIPBOARD_CLIPBOARD_H_ diff --git a/base/clipboard_linux.cc b/app/clipboard/clipboard_linux.cc index f49da3f..8b30ffd 100644 --- a/base/clipboard_linux.cc +++ b/app/clipboard/clipboard_linux.cc @@ -1,8 +1,8 @@ -// 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 "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include <gtk/gtk.h> #include <map> diff --git a/base/clipboard_mac.mm b/app/clipboard/clipboard_mac.mm index 954b601..77f286a 100644 --- a/base/clipboard_mac.mm +++ b/app/clipboard/clipboard_mac.mm @@ -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 "base/clipboard.h" +#include "app/clipboard/clipboard.h" #import <Cocoa/Cocoa.h> diff --git a/base/clipboard_unittest.cc b/app/clipboard/clipboard_unittest.cc index e6238ba..5b1d48a8 100644 --- a/base/clipboard_unittest.cc +++ b/app/clipboard/clipboard_unittest.cc @@ -4,12 +4,12 @@ #include <string> +#include "app/clipboard/clipboard.h" +#include "app/clipboard/scoped_clipboard_writer.h" #include "base/basictypes.h" -#include "base/clipboard.h" #include "base/gfx/size.h" #include "base/message_loop.h" #include "base/pickle.h" -#include "base/scoped_clipboard_writer.h" #include "base/string_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" diff --git a/base/clipboard_util.cc b/app/clipboard/clipboard_util_win.cc index 0102ebd..158ad81 100644 --- a/base/clipboard_util.cc +++ b/app/clipboard/clipboard_util_win.cc @@ -1,8 +1,8 @@ -// 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 "base/clipboard_util.h" +#include "app/clipboard/clipboard_util_win.h" #include <shellapi.h> #include <shlwapi.h> @@ -378,7 +378,7 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object, &description))) { ScopedHGlobal<FILEGROUPDESCRIPTOR> fgd(description.hGlobal); // We expect there to be at least one file in here. - DCHECK_GE(fgd->cItems, 1); + DCHECK_GE(fgd->cItems, 1u); filename->assign(fgd->fgd[0].cFileName); ReleaseStgMedium(&description); } diff --git a/base/clipboard_util.h b/app/clipboard/clipboard_util_win.h index 2a0b15e..5bbe8f0 100644 --- a/base/clipboard_util.h +++ b/app/clipboard/clipboard_util_win.h @@ -1,11 +1,11 @@ -// 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. // // Some helper functions for working with the clipboard and IDataObjects. -#ifndef BASE_CLIPBOARD_UTIL_H_ -#define BASE_CLIPBOARD_UTIL_H_ +#ifndef APP_CLIPBOARD_CLIPBOARD_UTIL_WIN_H_ +#define APP_CLIPBOARD_CLIPBOARD_UTIL_WIN_H_ #include <shlobj.h> #include <string> @@ -62,4 +62,4 @@ class ClipboardUtil { std::string* base_url); }; -#endif // BASE_CLIPBOARD_UTIL_H_ +#endif // APP_CLIPBOARD_CLIPBOARD_UTIL_WIN_H_ diff --git a/base/clipboard_win.cc b/app/clipboard/clipboard_win.cc index a8048e0..288c820 100644 --- a/base/clipboard_win.cc +++ b/app/clipboard/clipboard_win.cc @@ -1,16 +1,16 @@ -// 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. // Many of these functions are based on those found in // webkit/port/platform/PasteboardWin.cpp -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include <shlobj.h> #include <shellapi.h> -#include "base/clipboard_util.h" +#include "app/clipboard/clipboard_util_win.h" #include "base/file_path.h" #include "base/gfx/size.h" #include "base/lock.h" diff --git a/base/scoped_clipboard_writer.cc b/app/clipboard/scoped_clipboard_writer.cc index e464628..8c51afe 100644 --- a/base/scoped_clipboard_writer.cc +++ b/app/clipboard/scoped_clipboard_writer.cc @@ -1,13 +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. // This file implements the ScopedClipboardWriter class. Documentation on its -// purpose can be found in base/scoped_clipboard_writer.h. Documentation on the -// format of the parameters for each clipboard target can be found in -// base/clipboard.h. +// purpose can be found in our header. Documentation on the format of the +// parameters for each clipboard target can be found in clipboard.h. -#include "base/scoped_clipboard_writer.h" +#include "app/clipboard/scoped_clipboard_writer.h" #include "base/gfx/size.h" #include "base/pickle.h" diff --git a/base/scoped_clipboard_writer.h b/app/clipboard/scoped_clipboard_writer.h index feea7cd..4876a00 100644 --- a/base/scoped_clipboard_writer.h +++ b/app/clipboard/scoped_clipboard_writer.h @@ -7,13 +7,14 @@ // Upon deletion the class atomically writes all data to |clipboard_|, // avoiding any potential race condition with other processes that are also // writing to the system clipboard. -#ifndef BASE_SCOPED_CLIPBOARD_WRITER_H_ -#define BASE_SCOPED_CLIPBOARD_WRITER_H_ + +#ifndef APP_CLIPBOARD_SCOPED_CLIPBOARD_WRITER_H_ +#define APP_CLIPBOARD_SCOPED_CLIPBOARD_WRITER_H_ #include <string> #include <vector> -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/file_path.h" #include "base/string16.h" @@ -81,4 +82,4 @@ class ScopedClipboardWriter { DISALLOW_COPY_AND_ASSIGN(ScopedClipboardWriter); }; -#endif // BASE_SCOPED_CLIPBOARD_WRITER_H_ +#endif // APP_CLIPBOARD_SCOPED_CLIPBOARD_WRITER_H_ diff --git a/app/os_exchange_data_provider_win.cc b/app/os_exchange_data_provider_win.cc index 1d8bdd8..b407507 100644 --- a/app/os_exchange_data_provider_win.cc +++ b/app/os_exchange_data_provider_win.cc @@ -4,8 +4,8 @@ #include "app/os_exchange_data_provider_win.h" +#include "app/clipboard/clipboard_util_win.h" #include "app/l10n_util.h" -#include "base/clipboard_util.h" #include "base/file_util.h" #include "base/logging.h" #include "base/pickle.h" diff --git a/app/os_exchange_data_win_unittest.cc b/app/os_exchange_data_win_unittest.cc index 88f33b0..a237a2f 100644 --- a/app/os_exchange_data_win_unittest.cc +++ b/app/os_exchange_data_win_unittest.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 "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/pickle.h" #include "base/ref_counted.h" #include "base/scoped_handle.h" diff --git a/base/base.gyp b/base/base.gyp index f68564a..47818f5 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -83,13 +83,6 @@ 'base_switches.h', 'basictypes.h', 'bzip2_error_handler.cc', - 'clipboard.cc', - 'clipboard.h', - 'clipboard_linux.cc', - 'clipboard_mac.mm', - 'clipboard_util.cc', - 'clipboard_util.h', - 'clipboard_win.cc', 'cocoa_protocols_mac.h', 'command_line.cc', 'command_line.h', @@ -247,8 +240,6 @@ 'scoped_bstr_win.cc', 'scoped_bstr_win.h', 'scoped_cftyperef.h', - 'scoped_clipboard_writer.cc', - 'scoped_clipboard_writer.h', 'scoped_comptr_win.h', 'scoped_handle.h', 'scoped_handle_win.h', @@ -498,7 +489,6 @@ 'base_drag_source.cc', 'base_drop_target.cc', 'cpu.cc', - 'clipboard_util.cc', 'debug_on_start.cc', 'event_recorder.cc', 'file_version_info.cc', @@ -581,7 +571,6 @@ # Tests. 'at_exit_unittest.cc', 'atomicops_unittest.cc', - 'clipboard_unittest.cc', 'command_line_unittest.cc', 'condition_variable_unittest.cc', 'crypto/rsa_private_key_unittest.cc', 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" diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 51cfdf7..b484b0c 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/base/net_util.h" + #include <algorithm> #include <map> #include <unicode/ucnv.h> @@ -24,8 +26,6 @@ #include <fcntl.h> #endif -#include "net/base/net_util.h" - #include "base/basictypes.h" #include "base/file_path.h" #include "base/file_util.h" @@ -33,7 +33,6 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/path_service.h" -#include "base/scoped_clipboard_writer.h" #include "base/singleton.h" #include "base/stl_util-inl.h" #include "base/string_escape.h" @@ -1331,23 +1330,6 @@ std::wstring FormatUrl(const GURL& url, return url_string; } -void WriteURLToClipboard(const GURL& url, - const std::wstring& languages, - Clipboard *clipboard) { - if (url.is_empty() || !url.is_valid() || !clipboard) - return; - - string16 text = - // 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. - WideToUTF16(FormatUrl(url, languages, false, UnescapeRule::NONE, NULL, - NULL)); - - ScopedClipboardWriter scw(clipboard); - scw.WriteURL(text); -} - GURL SimplifyUrlForRequest(const GURL& url) { DCHECK(url.is_valid()); GURL::Replacements replacements; diff --git a/net/base/net_util.h b/net/base/net_util.h index 7d6cf81..4d7e0aa 100644 --- a/net/base/net_util.h +++ b/net/base/net_util.h @@ -19,7 +19,6 @@ #include "net/base/escape.h" struct addrinfo; -class Clipboard; class FilePath; class GURL; @@ -240,11 +239,6 @@ inline std::wstring FormatUrl(const GURL& url, const std::wstring& languages) { return FormatUrl(url, languages, true, UnescapeRule::SPACES, NULL, NULL); } -// Writes a string representation of |url| to the system clipboard. -void WriteURLToClipboard(const GURL& url, - const std::wstring& languages, - Clipboard *clipboard); - // Strip the portions of |url| that aren't core to the network request. // - user name / password // - reference section diff --git a/views/controls/message_box_view.cc b/views/controls/message_box_view.cc index a90d440..2544c03 100644 --- a/views/controls/message_box_view.cc +++ b/views/controls/message_box_view.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 "views/controls/message_box_view.h" +#include "app/clipboard/clipboard.h" +#include "app/clipboard/scoped_clipboard_writer.h" #include "app/l10n_util.h" #include "app/message_box_flags.h" -#include "base/clipboard.h" #include "base/message_loop.h" -#include "base/scoped_clipboard_writer.h" #include "base/string_util.h" #include "views/controls/button/checkbox.h" #include "views/standard_layout.h" diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc index d027156..0b997ee 100644 --- a/views/controls/textfield/native_textfield_win.cc +++ b/views/controls/textfield/native_textfield_win.cc @@ -4,13 +4,13 @@ #include <algorithm> +#include "app/clipboard/clipboard.h" +#include "app/clipboard/scoped_clipboard_writer.h" #include "app/l10n_util.h" #include "app/l10n_util_win.h" #include "app/win_util.h" -#include "base/clipboard.h" #include "base/gfx/native_theme.h" #include "base/keyboard_codes.h" -#include "base/scoped_clipboard_writer.h" #include "base/string_util.h" #include "base/win_util.h" #include "grit/app_strings.h" diff --git a/webkit/glue/scoped_clipboard_writer_glue.h b/webkit/glue/scoped_clipboard_writer_glue.h index d42263f..14917a3 100644 --- a/webkit/glue/scoped_clipboard_writer_glue.h +++ b/webkit/glue/scoped_clipboard_writer_glue.h @@ -1,11 +1,11 @@ -// 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. #ifndef SCOPED_CLIPBOARD_WRITER_GLUE_H_ #define SCOPED_CLIPBOARD_WRITER_GLUE_H_ -#include "base/scoped_clipboard_writer.h" +#include "app/clipboard/scoped_clipboard_writer.h" class SkBitmap; diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index 0341079..624cc3b 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -4,7 +4,7 @@ #include "webkit/glue/webclipboard_impl.h" -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/logging.h" #include "base/string_util.h" #include "googleurl/src/gurl.h" diff --git a/webkit/glue/webclipboard_impl.h b/webkit/glue/webclipboard_impl.h index 6612d8e..330752a 100644 --- a/webkit/glue/webclipboard_impl.h +++ b/webkit/glue/webclipboard_impl.h @@ -5,7 +5,7 @@ #ifndef WEBCLIPBOARD_IMPL_H_ #define WEBCLIPBOARD_IMPL_H_ -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "webkit/api/public/WebClipboard.h" #include <string> diff --git a/webkit/glue/webdropdata_win.cc b/webkit/glue/webdropdata_win.cc index d3a67b5..016fcc0 100644 --- a/webkit/glue/webdropdata_win.cc +++ b/webkit/glue/webdropdata_win.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. @@ -8,7 +8,7 @@ #include <shellapi.h> #include <shlobj.h> -#include "base/clipboard_util.h" +#include "app/clipboard/clipboard_util_win.h" #include "googleurl/src/gurl.h" // static diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index 1874510..68040b3 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -14,7 +14,7 @@ #include <string> #include <vector> -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/file_path.h" #include "base/string16.h" #include "webkit/api/public/WebCanvas.h" diff --git a/webkit/tools/test_shell/mock_webclipboard_impl.cc b/webkit/tools/test_shell/mock_webclipboard_impl.cc index 6cbf829..c04e4b8 100644 --- a/webkit/tools/test_shell/mock_webclipboard_impl.cc +++ b/webkit/tools/test_shell/mock_webclipboard_impl.cc @@ -4,7 +4,7 @@ #include "webkit/tools/test_shell/mock_webclipboard_impl.h" -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/logging.h" #include "base/string_util.h" #include "net/base/escape.h" diff --git a/webkit/tools/test_shell/simple_clipboard_impl.cc b/webkit/tools/test_shell/simple_clipboard_impl.cc index fc67ece..c727f62 100644 --- a/webkit/tools/test_shell/simple_clipboard_impl.cc +++ b/webkit/tools/test_shell/simple_clipboard_impl.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. @@ -6,7 +6,7 @@ #include <string> -#include "base/clipboard.h" +#include "app/clipboard/clipboard.h" #include "base/lazy_instance.h" #include "base/string16.h" #include "googleurl/src/gurl.h" diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp index a893e08..5a84cc8 100644 --- a/webkit/webkit.gyp +++ b/webkit/webkit.gyp @@ -399,6 +399,7 @@ 'type': '<(library)', 'msvs_guid': 'C66B126D-0ECE-4CA2-B6DC-FA780AFBBF09', 'dependencies': [ + '../app/app.gyp:app_base', '../net/net.gyp:net', 'inspector_resources', '../third_party/WebKit/WebCore/WebCore.gyp/WebCore.gyp:webcore', |