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

Unified Diff: chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm

Issue 6995074: [Mac] Don't copy text typed into the find bar to the find pasteboard in incognito windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment Created 9 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
index bd6e6183bdef8b6556b3d3d86a8d109b3fdd4779..082dd0d7e29880c42f793211e48495e5bc283475 100644
--- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
@@ -4,8 +4,10 @@
#import <Cocoa/Cocoa.h>
+#include "base/auto_reset.h"
#include "base/mac/mac_util.h"
#include "base/sys_string_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.h"
#import "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
@@ -170,9 +172,12 @@ const float kRightEdgeOffset = 25;
FindTabHelper* find_tab_helper = tab_contents->find_tab_helper();
NSString* findText = [findText_ stringValue];
- suppressPboardUpdateActions_ = YES;
- [[FindPasteboard sharedInstance] setFindText:findText];
- suppressPboardUpdateActions_ = NO;
+ // Only copy typed text to the FindPasteboard for non-incognito windows, see
+ // http://crbug.com/85306.
+ if (!tab_contents->profile()->IsOffTheRecord()) {
+ AutoReset<BOOL> auto_reset(&suppressPboardUpdateActions_, YES);
+ [[FindPasteboard sharedInstance] setFindText:findText];
+ }
if ([findText length] > 0) {
find_tab_helper->
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698