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

Unified Diff: chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm

Issue 78053009: Adds handling of clicking on the omnibox search/go button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/browser/ui/cocoa/location_bar/search_button_decoration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm b/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
index 562a2c3f8b65c3483ab858b4bff9f420ca5768e0..e3cb05ee569ce5d608c3c4f4dcf52fd675272ccb 100644
--- a/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/search_button_decoration.mm
@@ -4,6 +4,8 @@
#import "chrome/browser/ui/cocoa/location_bar/search_button_decoration.h"
+#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
+#import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
#include "grit/theme_resources.h"
#include "ui/base/resource/resource_bundle.h"
@@ -14,7 +16,7 @@ const CGFloat kLeftPadding = 3;
} // namespace
-SearchButtonDecoration::SearchButtonDecoration()
+SearchButtonDecoration::SearchButtonDecoration(LocationBarViewMac* owner)
: ButtonDecoration({
IDR_OMNIBOX_SEARCH_BUTTON_TOP_LEFT,
IDR_OMNIBOX_SEARCH_BUTTON_TOP,
@@ -45,7 +47,9 @@ SearchButtonDecoration::SearchButtonDecoration()
IDR_OMNIBOX_SEARCH_BUTTON_PRESSED_BOTTOM_LEFT,
IDR_OMNIBOX_SEARCH_BUTTON_PRESSED_BOTTOM,
IDR_OMNIBOX_SEARCH_BUTTON_PRESSED_BOTTOM_RIGHT
- }, IDR_OMNIBOX_SEARCH_BUTTON_LOUPE, kInnerPadding) {
+ }, IDR_OMNIBOX_SEARCH_BUTTON_LOUPE, kInnerPadding),
+ owner_(owner) {
+ DCHECK(owner_);
}
SearchButtonDecoration::~SearchButtonDecoration() {
@@ -68,7 +72,7 @@ void SearchButtonDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
}
bool SearchButtonDecoration::OnMousePressed(NSRect frame) {
- // TODO(macourteau): handle click (trigger navigation of what is currently
- // in the omnibox).
+ owner_->GetOmniboxView()->model()->AcceptInput(
+ owner_->GetWindowOpenDisposition(), false);
return true;
}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/search_button_decoration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698