diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 03:52:11 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 03:52:11 +0000 |
commit | 1a6b30a619cba771cb9c4ed4da9c3778634567ad (patch) | |
tree | 4ced69ac8eb511a6f9bc7949348551ee62b57989 /chrome/browser/autocomplete | |
parent | a8815b3277284778247545728bc41a077ff55b43 (diff) | |
download | chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.zip chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.tar.gz chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.tar.bz2 |
This changelist represents the necessary merger of two others:
http://codereview.chromium.org/172082
Create new event_utils.h file for Cocoa-specific event to WindowOpenDisposition
cracking.
Hook this up to BookmarkBarController so that clicks to bookmark items use the
oracle function to determine where the bookmark should be opened.
BUG=17301
TEST=Cmd+Click etc on bookmark items should work. See bug and unit test
attached.
http://codereview.chromium.org/174021
Convert users of the "get last active browser, get selected tab contents, open
url" pattern to just call OpenURL on Browser directly.
Makes GetOrCreateTabbedBrowser public on Browser, and makes it static so it can
be called with a provided profile.
BUG=none
TEST=Try opening links from the bookmark/history menus on mac, with and without
an existing window open, with an active incognito window, etc. The links should
all open in the last active non-incognito window, or create a new non-incognito
window if none is open.
Review URL: http://codereview.chromium.org/173044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm | 10 | ||||
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_mac.mm | 14 |
2 files changed, 12 insertions, 12 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm index 9ba16ef..5843584 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_edit_view_mac.mm @@ -15,8 +15,8 @@ #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/cocoa/autocomplete_text_field.h" +#include "chrome/browser/cocoa/event_utils.h" #include "chrome/browser/tab_contents/tab_contents.h" -#import "chrome/common/cocoa_utils.h" // Focus-handling between |field_| and |model_| is a bit subtle. // Other platforms detect change of focus, which is inconvenient @@ -692,8 +692,8 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) { NSEvent* event = [NSApp currentEvent]; if (cmd == @selector(insertNewline:) || (cmd == @selector(noop:) && [event keyCode] == kVK_Return)) { - WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( - [event modifierFlags]); + WindowOpenDisposition disposition = + event_utils::WindowOpenDispositionFromNSEvent(event); edit_view_->AcceptInput(disposition, false); return YES; } @@ -704,8 +704,8 @@ std::wstring AutocompleteEditViewMac::GetClipboardText(Clipboard* clipboard) { // is safe to tell it twice. if (cmd == @selector(insertLineBreak:)) { edit_view_->OnControlKeyChanged(true); - WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( - [[NSApp currentEvent] modifierFlags]); + WindowOpenDisposition disposition = + event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); edit_view_->AcceptInput(disposition, false); return YES; } diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 1d54c9e..c545ee4 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -8,8 +8,8 @@ #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" +#include "chrome/browser/cocoa/event_utils.h" #include "chrome/browser/cocoa/nsimage_cache.h" -#import "chrome/common/cocoa_utils.h" namespace { @@ -268,9 +268,9 @@ void AutocompletePopupViewMac::CreatePopupIfNeeded() { // We need the popup to follow window resize. NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc addObserver:matrix_target_ - selector:@selector(windowDidResize:) - name:NSWindowDidResizeNotification + [nc addObserver:matrix_target_ + selector:@selector(windowDidResize:) + name:NSWindowDidResizeNotification object:[field_ window]]; } } @@ -287,7 +287,7 @@ void AutocompletePopupViewMac::UpdatePopupAppearance() { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:matrix_target_ - name:NSWindowDidResizeNotification + name:NSWindowDidResizeNotification object:[field_ window]]; popup_.reset(nil); @@ -380,8 +380,8 @@ void AutocompletePopupViewMac::AcceptInput() { PaintUpdatesNow(); } else { model_->SetSelectedLine(selectedRow, false); - WindowOpenDisposition disposition = event_utils::DispositionFromEventFlags( - [[NSApp currentEvent] modifierFlags]); + WindowOpenDisposition disposition = + event_utils::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); edit_view_->AcceptInput(disposition, false); } } |