OLD | NEW |
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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 } // namespace | 33 } // namespace |
34 | 34 |
35 | 35 |
36 ActionBoxButtonView::ActionBoxButtonView(Browser* browser, Profile* profile) | 36 ActionBoxButtonView::ActionBoxButtonView(Browser* browser, Profile* profile) |
37 : views::MenuButton(NULL, string16(), this, false), | 37 : views::MenuButton(NULL, string16(), this, false), |
38 browser_(browser), | 38 browser_(browser), |
39 profile_(profile), | 39 profile_(profile), |
40 starred_(false) { | 40 starred_(false) { |
41 set_id(VIEW_ID_ACTION_BOX_BUTTON); | 41 set_id(VIEW_ID_ACTION_BOX_BUTTON); |
42 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); | 42 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); |
43 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 43 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
44 IDR_ACTION_BOX_BUTTON)); | 44 IDR_ACTION_BOX_BUTTON)); |
45 set_accessibility_focusable(true); | 45 set_accessibility_focusable(true); |
46 set_border(NULL); | 46 set_border(NULL); |
47 } | 47 } |
48 | 48 |
49 ActionBoxButtonView::~ActionBoxButtonView() { | 49 ActionBoxButtonView::~ActionBoxButtonView() { |
50 } | 50 } |
51 | 51 |
52 SkColor ActionBoxButtonView::GetBackgroundColor() { | 52 SkColor ActionBoxButtonView::GetBackgroundColor() { |
53 switch (state()) { | 53 switch (state()) { |
(...skipping 25 matching lines...) Expand all Loading... |
79 void ActionBoxButtonView::OnMenuButtonClicked(View* source, | 79 void ActionBoxButtonView::OnMenuButtonClicked(View* source, |
80 const gfx::Point& point) { | 80 const gfx::Point& point) { |
81 ExtensionService* extension_service = | 81 ExtensionService* extension_service = |
82 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 82 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
83 | 83 |
84 ActionBoxMenuModel model(extension_service); | 84 ActionBoxMenuModel model(extension_service); |
85 ActionBoxMenu action_box_menu(browser_, &model, starred_); | 85 ActionBoxMenu action_box_menu(browser_, &model, starred_); |
86 action_box_menu.Init(); | 86 action_box_menu.Init(); |
87 action_box_menu.RunMenu(this); | 87 action_box_menu.RunMenu(this); |
88 } | 88 } |
OLD | NEW |