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

Side by Side Diff: chrome/browser/ui/views/location_bar/action_box_button_view.cc

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 #include "chrome/browser/ui/views/location_bar/action_box_button_view.h" 5 #include "chrome/browser/ui/views/location_bar/action_box_button_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/command_updater.h" 10 #include "chrome/browser/command_updater.h"
(...skipping 17 matching lines...) Expand all
28 const SkColor kHotBackgroundColor = SkColorSetRGB(239, 239, 239); 28 const SkColor kHotBackgroundColor = SkColorSetRGB(239, 239, 239);
29 const SkColor kPushedBackgroundColor = SkColorSetRGB(207, 207, 207); 29 const SkColor kPushedBackgroundColor = SkColorSetRGB(207, 207, 207);
30 30
31 const SkColor kNormalBorderColor = SkColorSetRGB(255, 255, 255); 31 const SkColor kNormalBorderColor = SkColorSetRGB(255, 255, 255);
32 const SkColor kHotBorderColor = SkColorSetRGB(223, 223, 223); 32 const SkColor kHotBorderColor = SkColorSetRGB(223, 223, 223);
33 const SkColor kPushedBorderColor = SkColorSetRGB(191, 191, 191); 33 const SkColor kPushedBorderColor = SkColorSetRGB(191, 191, 191);
34 34
35 } // namespace 35 } // namespace
36 36
37 37
38 ActionBoxButtonView::ActionBoxButtonView(Browser* browser, Profile* profile) 38 ActionBoxButtonView::ActionBoxButtonView(Browser* browser, Profile* profile,
msw 2012/08/29 19:27:04 nit: one arg per line.
Cait (Slow) 2012/08/29 20:26:14 Done.
39 CommandUpdater* command_updater)
39 : views::MenuButton(NULL, string16(), this, false), 40 : views::MenuButton(NULL, string16(), this, false),
40 browser_(browser), 41 browser_(browser),
41 profile_(profile) { 42 profile_(profile),
43 command_updater_(command_updater) {
42 set_id(VIEW_ID_ACTION_BOX_BUTTON); 44 set_id(VIEW_ID_ACTION_BOX_BUTTON);
43 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); 45 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON));
44 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 46 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
45 IDR_ACTION_BOX_BUTTON)); 47 IDR_ACTION_BOX_BUTTON));
46 set_accessibility_focusable(true); 48 set_accessibility_focusable(true);
47 set_border(NULL); 49 set_border(NULL);
48 } 50 }
49 51
50 ActionBoxButtonView::~ActionBoxButtonView() { 52 ActionBoxButtonView::~ActionBoxButtonView() {
51 } 53 }
(...skipping 28 matching lines...) Expand all
80 void ActionBoxButtonView::GetAccessibleState(ui::AccessibleViewState* state) { 82 void ActionBoxButtonView::GetAccessibleState(ui::AccessibleViewState* state) {
81 MenuButton::GetAccessibleState(state); 83 MenuButton::GetAccessibleState(state);
82 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ACTION_BOX_BUTTON); 84 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ACTION_BOX_BUTTON);
83 } 85 }
84 86
85 void ActionBoxButtonView::OnMenuButtonClicked(View* source, 87 void ActionBoxButtonView::OnMenuButtonClicked(View* source,
86 const gfx::Point& point) { 88 const gfx::Point& point) {
87 ExtensionService* extension_service = 89 ExtensionService* extension_service =
88 extensions::ExtensionSystem::Get(profile_)->extension_service(); 90 extensions::ExtensionSystem::Get(profile_)->extension_service();
89 91
90 ActionBoxMenuModel model(browser_, extension_service); 92 ActionBoxMenuModel model(browser_, extension_service, command_updater_);
91 ActionBoxMenu action_box_menu(browser_, &model); 93 ActionBoxMenu action_box_menu(browser_, &model);
92 action_box_menu.Init(); 94 action_box_menu.Init();
93 action_box_menu.RunMenu(this); 95 action_box_menu.RunMenu(this);
94 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698