diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 17:17:13 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-30 17:17:13 +0000 |
commit | ad61963c488d2ac267ba1a98f75a2c8781bc5a13 (patch) | |
tree | 3f461af72e7633e14c2d96136341d1a47ba8dd1f /content | |
parent | a0011476ee7c46bfbab491386f4d987e9ecb05be (diff) | |
download | chromium_src-ad61963c488d2ac267ba1a98f75a2c8781bc5a13.zip chromium_src-ad61963c488d2ac267ba1a98f75a2c8781bc5a13.tar.gz chromium_src-ad61963c488d2ac267ba1a98f75a2c8781bc5a13.tar.bz2 |
Get rid of ContentBrowserClient::GetClipboard as part of simplifying the work that each embedder has to do.
Also remove some code in the views WebView example that isn't needed.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/10442078
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139558 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/mock_content_browser_client.cc | 5 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.h | 1 | ||||
-rw-r--r-- | content/browser/renderer_host/clipboard_message_filter.cc | 15 | ||||
-rw-r--r-- | content/public/browser/content_browser_client.cc | 4 | ||||
-rw-r--r-- | content/public/browser/content_browser_client.h | 5 | ||||
-rw-r--r-- | content/shell/shell_browser_main_parts.cc | 7 | ||||
-rw-r--r-- | content/shell/shell_browser_main_parts.h | 6 | ||||
-rw-r--r-- | content/shell/shell_content_browser_client.cc | 5 | ||||
-rw-r--r-- | content/shell/shell_content_browser_client.h | 1 |
9 files changed, 10 insertions, 39 deletions
diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index 4c48a6a..e0230ba 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -29,11 +29,6 @@ WebContentsView* MockContentBrowserClient::OverrideCreateWebContentsView( return rv; } -ui::Clipboard* MockContentBrowserClient::GetClipboard() { - static ui::Clipboard clipboard; - return &clipboard; -} - FilePath MockContentBrowserClient::GetDefaultDownloadDirectory() { if (!download_dir_.IsValid()) { bool result = download_dir_.CreateUniqueTempDir(); diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index 4a7157b..b497a87 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -24,7 +24,6 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual WebContentsView* OverrideCreateWebContentsView( WebContents* web_contents, RenderViewHostDelegateView** render_view_host_delegate_view) OVERRIDE; - virtual ui::Clipboard* GetClipboard() OVERRIDE; virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; private: diff --git a/content/browser/renderer_host/clipboard_message_filter.cc b/content/browser/renderer_host/clipboard_message_filter.cc index 25b2fd7..1de011e 100644 --- a/content/browser/renderer_host/clipboard_message_filter.cc +++ b/content/browser/renderer_host/clipboard_message_filter.cc @@ -14,7 +14,6 @@ #include "base/bind_helpers.h" #include "base/stl_util.h" #include "content/common/clipboard_messages.h" -#include "content/public/browser/content_browser_client.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message_macros.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -23,17 +22,23 @@ using content::BrowserThread; +#if defined(OS_WIN) + namespace { -// This helper is needed because content::ContentBrowserClient::GetClipboard() -// must be called on the UI thread. +// The write must be performed on the UI thread because the clipboard object +// from the IO thread cannot create windows so it cannot be the "owner" of the +// clipboard's contents. // See http://crbug.com/5823. void WriteObjectsHelper(const ui::Clipboard::ObjectMap* objects) { - content::GetContentClient()->browser()->GetClipboard()->WriteObjects( - ui::Clipboard::BUFFER_STANDARD, *objects); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + static ui::Clipboard* clipboard = new ui::Clipboard; + clipboard->WriteObjects(ui::Clipboard::BUFFER_STANDARD, *objects); } } // namespace +#endif + ClipboardMessageFilter::ClipboardMessageFilter() { } diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index a70e618..b5abf12c 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc @@ -178,10 +178,6 @@ SpeechRecognitionManagerDelegate* return NULL; } -ui::Clipboard* ContentBrowserClient::GetClipboard() { - return NULL; -} - net::NetLog* ContentBrowserClient::GetNetLog() { return NULL; } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index 0d62260..fcf53c7 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -43,10 +43,6 @@ class URLRequestContext; class X509Certificate; } -namespace ui { -class Clipboard; -} - namespace content { class AccessTokenStore; @@ -358,7 +354,6 @@ class CONTENT_EXPORT ContentBrowserClient { GetSpeechRecognitionManagerDelegate(); // Getters for common objects. - virtual ui::Clipboard* GetClipboard(); virtual net::NetLog* GetNetLog(); // Creates a new AccessTokenStore for gelocation. diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc index c7d0b4b..d2b020b 100644 --- a/content/shell/shell_browser_main_parts.cc +++ b/content/shell/shell_browser_main_parts.cc @@ -17,7 +17,6 @@ #include "content/shell/shell_switches.h" #include "googleurl/src/gurl.h" #include "net/base/net_module.h" -#include "ui/base/clipboard/clipboard.h" #if defined(OS_ANDROID) #include "base/message_pump_android.h" @@ -107,10 +106,4 @@ bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { return false; } -ui::Clipboard* ShellBrowserMainParts::GetClipboard() { - if (!clipboard_.get()) - clipboard_.reset(new ui::Clipboard()); - return clipboard_.get(); -} - } // namespace diff --git a/content/shell/shell_browser_main_parts.h b/content/shell/shell_browser_main_parts.h index 4bf9e97..24cae7c 100644 --- a/content/shell/shell_browser_main_parts.h +++ b/content/shell/shell_browser_main_parts.h @@ -14,10 +14,6 @@ namespace base { class Thread; } -namespace ui { -class Clipboard; -} - namespace content { class ShellBrowserContext; @@ -41,7 +37,6 @@ class ShellBrowserMainParts : public BrowserMainParts { virtual void PostMainMessageLoopRun() OVERRIDE; virtual void PostDestroyThreads() OVERRIDE {} - ui::Clipboard* GetClipboard(); ShellDevToolsDelegate* devtools_delegate() { return devtools_delegate_; } ShellBrowserContext* browser_context() { return browser_context_.get(); } @@ -49,7 +44,6 @@ class ShellBrowserMainParts : public BrowserMainParts { private: scoped_ptr<ShellBrowserContext> browser_context_; - scoped_ptr<ui::Clipboard> clipboard_; ShellDevToolsDelegate* devtools_delegate_; DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc index ae2e3ea..530fa4a 100644 --- a/content/shell/shell_content_browser_client.cc +++ b/content/shell/shell_content_browser_client.cc @@ -49,11 +49,6 @@ void ShellContentBrowserClient::ResourceDispatcherHostCreated() { resource_dispatcher_host_delegate_.get()); } -ui::Clipboard* ShellContentBrowserClient::GetClipboard() { - return shell_browser_main_parts_->GetClipboard(); -} - - std::string ShellContentBrowserClient::GetDefaultDownloadName() { return "download"; } diff --git a/content/shell/shell_content_browser_client.h b/content/shell/shell_content_browser_client.h index 0025f0d..01ef569 100644 --- a/content/shell/shell_content_browser_client.h +++ b/content/shell/shell_content_browser_client.h @@ -31,7 +31,6 @@ class ShellContentBrowserClient : public ContentBrowserClient { virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, int child_process_id) OVERRIDE; virtual void ResourceDispatcherHostCreated() OVERRIDE; - virtual ui::Clipboard* GetClipboard() OVERRIDE; virtual std::string GetDefaultDownloadName() OVERRIDE; ShellBrowserContext* browser_context(); |