diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 20:20:49 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-15 20:20:49 +0000 |
commit | ee2df648776cc000aded2b737608b805039cf5e8 (patch) | |
tree | a49a6c4aeee53e399f7751be1d9f39037aef109b /chrome/browser/cocoa/toolbar_controller.h | |
parent | 084820e2662059decc9b3281b37c05ae55a13da0 (diff) | |
download | chromium_src-ee2df648776cc000aded2b737608b805039cf5e8.zip chromium_src-ee2df648776cc000aded2b737608b805039cf5e8.tar.gz chromium_src-ee2df648776cc000aded2b737608b805039cf5e8.tar.bz2 |
Fix http://crbug.com/13971: OSX: Text copied from Omnibox is styled
Provide a custom field editor for the location bar that overrides cut/copy to only write plain text to the clipboard.
BUG=13971
TEST=Type a URL in the Omnibox, select all and copy url, open Textedit and paste the url into it. Expected results: url should be unstyled previous behavior: styled text (as it appeared in the Omnibox was pasted)
Review URL: http://codereview.chromium.org/126075
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/toolbar_controller.h')
-rw-r--r-- | chrome/browser/cocoa/toolbar_controller.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/toolbar_controller.h b/chrome/browser/cocoa/toolbar_controller.h index 1909800..1aa38bb 100644 --- a/chrome/browser/cocoa/toolbar_controller.h +++ b/chrome/browser/cocoa/toolbar_controller.h @@ -8,6 +8,7 @@ #import <Cocoa/Cocoa.h> #include "base/scoped_ptr.h" +#include "base/scoped_nsobject.h" #import "chrome/browser/cocoa/command_observer_bridge.h" class CommandUpdater; @@ -18,6 +19,15 @@ class TabContents; class ToolbarModel; class ToolbarView; +// Field editor used for the location bar. +@interface LocationBarFieldEditor : NSTextView +// Copy contents of the TextView to the designated clipboard as plain text. +- (void)performCopy:(NSPasteboard*)pb; + +// Same as above, note that this calls through to performCopy. +- (void)performCut:(NSPasteboard*)pb; +@end + // A controller for the toolbar in the browser window. Manages updating the // state for location bar and back/fwd/reload/go buttons. @@ -28,6 +38,7 @@ class ToolbarView; Profile* profile_; // weak, one per window scoped_ptr<CommandObserverBridge> commandObserver_; scoped_ptr<LocationBarViewMac> locationBarView_; + scoped_nsobject<LocationBarFieldEditor> locationBarFieldEditor_; // strong // The ordering is important for unit tests. If new items are added or the // ordering is changed, make sure to update |-toolbarViews| and the @@ -49,6 +60,12 @@ class ToolbarView; // Get the C++ bridge object representing the location bar for this tab. - (LocationBar*)locationBar; +// Called by the Window delegate so we can provide a custom field editor if +// needed. +// Note that this may be called for objects unrelated to the toolbar. +// returns nil if we don't want to override the custom field editor for |obj|. +- (id)customFieldEditorForObject:(id)obj; + // Make the location bar the first responder, if possible. - (void)focusLocationBar; |