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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 12041078: Clear the clipboard closing Incognito window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge with master Created 7 years, 11 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
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index ef202011c16004e50f2f6afee24afcbf6ad48f4d..98015efab8fb95b62eb06492eb9174d0d9447998 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/character_encoding.h"
#include "chrome/browser/chrome_benchmarking_message_filter.h"
#include "chrome/browser/chrome_quota_permission_context.h"
+#include "chrome/browser/clipboard/incognito_marker.h"
#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
@@ -94,6 +95,7 @@
#include "content/public/browser/browser_url_handler.h"
#include "content/public/browser/child_process_data.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/clipboard_write_callback_params.h"
#include "content/public/browser/compositor_util.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -1947,6 +1949,14 @@ FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() {
return directory.Append(FILE_PATH_LITERAL("Hyphen"));
}
+void ChromeContentBrowserClient::BeforeWriteToClipboard(
+ const content::ClipboardWriteCallbackParams& params) {
+ DCHECK(params.browser_context != NULL);
+ Profile* profile = Profile::FromBrowserContext(params.browser_context);
+ DCHECK(profile != NULL);
+ AddIncognitoMarkerForOffTheRecordProfile(params.objects, profile);
+}
+
#if defined(OS_POSIX) && !defined(OS_MACOSX)
void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const CommandLine& command_line,

Powered by Google App Engine
This is Rietveld 408576698