Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(663)

Unified Diff: content/browser/browser_context.cc

Issue 12298037: Revert 183123 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1417/src/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | content/browser/renderer_host/clipboard_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
===================================================================
--- content/browser/browser_context.cc (revision 183210)
+++ content/browser/browser_context.cc (working copy)
@@ -23,7 +23,6 @@
#include "net/cookies/cookie_store.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
-#include "ui/base/clipboard/clipboard.h"
#include "webkit/database/database_tracker.h"
#include "webkit/fileapi/external_mount_points.h"
#endif // !OS_IOS
@@ -37,7 +36,6 @@
namespace {
// Key names on BrowserContext.
-const char kClipboardDestroyerKey[] = "clipboard_destroyer";
const char kDownloadManagerKeyName[] = "download_manager";
const char kMountPointsKey[] = "mount_points";
const char kStorageParitionMapKeyName[] = "content_storage_partition_map";
@@ -94,42 +92,6 @@
appcache_service->PurgeMemory();
}
-// OffTheRecordClipboardDestroyer is supposed to clear the clipboard in
-// destructor if current clipboard content came from corresponding OffTheRecord
-// browser context.
-class OffTheRecordClipboardDestroyer : public base::SupportsUserData::Data {
- public:
- virtual ~OffTheRecordClipboardDestroyer() {
- ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
- ExamineClipboard(clipboard, ui::Clipboard::BUFFER_STANDARD);
- if (ui::Clipboard::IsValidBuffer(ui::Clipboard::BUFFER_SELECTION))
- ExamineClipboard(clipboard, ui::Clipboard::BUFFER_SELECTION);
- }
-
- ui::Clipboard::SourceTag GetAsSourceTag() {
- return ui::Clipboard::SourceTag(this);
- }
-
- private:
- void ExamineClipboard(ui::Clipboard* clipboard,
- ui::Clipboard::Buffer buffer) {
- ui::Clipboard::SourceTag source_tag = clipboard->ReadSourceTag(buffer);
- if (source_tag == ui::Clipboard::SourceTag(this))
- clipboard->Clear(buffer);
- }
-};
-
-// Returns existing OffTheRecordClipboardDestroyer or creates one.
-OffTheRecordClipboardDestroyer* GetClipboardDestroyerForBrowserContext(
- BrowserContext* context) {
- if (base::SupportsUserData::Data* data = context->GetUserData(
- kClipboardDestroyerKey))
- return static_cast<OffTheRecordClipboardDestroyer*>(data);
- OffTheRecordClipboardDestroyer* data = new OffTheRecordClipboardDestroyer;
- context->SetUserData(kClipboardDestroyerKey, data);
- return data;
-}
-
} // namespace
// static
@@ -311,17 +273,6 @@
ForEachStoragePartition(browser_context,
base::Bind(&PurgeDOMStorageContextInPartition));
}
-
-ui::Clipboard::SourceTag BrowserContext::GetMarkerForOffTheRecordContext(
- BrowserContext* context) {
- if (context && context->IsOffTheRecord()) {
- OffTheRecordClipboardDestroyer* clipboard_destroyer =
- GetClipboardDestroyerForBrowserContext(context);
-
- return clipboard_destroyer->GetAsSourceTag();
- }
- return ui::Clipboard::SourceTag();
-}
#endif // !OS_IOS
BrowserContext::~BrowserContext() {
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | content/browser/renderer_host/clipboard_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698