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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/plus_decoration.mm

Issue 10887029: Only show chrome2mobile in action box if it is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/location_bar/plus_decoration.h" 5 #import "chrome/browser/ui/cocoa/location_bar/plus_decoration.h"
6 6
7 #include "chrome/browser/command_updater.h" 7 #include "chrome/browser/command_updater.h"
8 #include "chrome/browser/extensions/extension_system.h" 8 #include "chrome/browser/extensions/extension_system.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_commands.h" 10 #include "chrome/browser/ui/browser_commands.h"
(...skipping 29 matching lines...) Expand all
40 PlusDecoration::~PlusDecoration() { 40 PlusDecoration::~PlusDecoration() {
41 } 41 }
42 42
43 bool PlusDecoration::AcceptsMousePress() { 43 bool PlusDecoration::AcceptsMousePress() {
44 return true; 44 return true;
45 } 45 }
46 46
47 bool PlusDecoration::OnMousePressed(NSRect frame) { 47 bool PlusDecoration::OnMousePressed(NSRect frame) {
48 ExtensionService* extension_service = extensions::ExtensionSystem::Get( 48 ExtensionService* extension_service = extensions::ExtensionSystem::Get(
49 browser_->profile())->extension_service(); 49 browser_->profile())->extension_service();
50 ActionBoxMenuModel menu_model(browser_, extension_service); 50 ActionBoxMenuModel menu_model(browser_, extension_service, command_updater_);
51 51
52 // Controller for the menu attached to the plus decoration. 52 // Controller for the menu attached to the plus decoration.
53 scoped_nsobject<MenuController> menu_controller( 53 scoped_nsobject<MenuController> menu_controller(
54 [[MenuController alloc] initWithModel:&menu_model 54 [[MenuController alloc] initWithModel:&menu_model
55 useWithPopUpButtonCell:YES]); 55 useWithPopUpButtonCell:YES]);
56 56
57 NSMenu* menu = [menu_controller menu]; 57 NSMenu* menu = [menu_controller menu];
58 58
59 // Align the menu popup to that its top-right corner matches the bottom-right 59 // Align the menu popup to that its top-right corner matches the bottom-right
60 // corner of the omnibox. 60 // corner of the omnibox.
(...skipping 14 matching lines...) Expand all
75 75
76 NSString* PlusDecoration::GetToolTip() { 76 NSString* PlusDecoration::GetToolTip() {
77 return tooltip_.get(); 77 return tooltip_.get();
78 } 78 }
79 79
80 NSPoint PlusDecoration::GetActionBoxAnchorPoint() { 80 NSPoint PlusDecoration::GetActionBoxAnchorPoint() {
81 AutocompleteTextField* field = owner_->GetAutocompleteTextField(); 81 AutocompleteTextField* field = owner_->GetAutocompleteTextField();
82 NSRect bounds = [field bounds]; 82 NSRect bounds = [field bounds];
83 return NSMakePoint(NSMaxX(bounds), NSMaxY(bounds)); 83 return NSMakePoint(NSMaxX(bounds), NSMaxY(bounds));
84 } 84 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/action_box_menu_model.h » ('j') | chrome/browser/ui/toolbar/action_box_menu_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698