Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/ui/views/location_bar/action_box_button_view.h" | |
| 6 | |
| 7 #include "base/utf_string_conversions.h" | |
| 8 #include "chrome/app/chrome_command_ids.h" | |
| 9 #include "chrome/browser/command_updater.h" | |
| 10 #include "chrome/browser/ui/view_ids.h" | |
| 11 #include "chrome/browser/ui/views/browser_dialogs.h" | |
| 12 #include "grit/generated_resources.h" | |
| 13 #include "grit/theme_resources.h" | |
| 14 #include "grit/theme_resources_standard.h" | |
| 15 #include "ui/base/accessibility/accessible_view_state.h" | |
| 16 #include "ui/base/l10n/l10n_util.h" | |
| 17 #include "ui/base/resource/resource_bundle.h" | |
| 18 | |
| 19 ActionBoxButtonView::ActionBoxButtonView(CommandUpdater* command_updater) | |
| 20 : views::MenuButton(NULL, string16(), this, false), | |
| 21 command_updater_(command_updater) { | |
|
Aaron Boodman
2012/05/17 20:42:05
The command_updater_ is not used. Better to leave
yefimt
2012/05/17 22:42:52
Done.
| |
| 22 set_id(VIEW_ID_ACTION_BOX_BUTTON); | |
| 23 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); | |
| 24 SetImages(); | |
| 25 set_accessibility_focusable(true); | |
| 26 set_border(NULL); | |
| 27 } | |
| 28 | |
| 29 ActionBoxButtonView::~ActionBoxButtonView() { | |
| 30 } | |
| 31 | |
| 32 void ActionBoxButtonView::SetImages() { | |
|
Aaron Boodman
2012/05/17 20:42:05
In the case of AppMenuButtonView, the container do
| |
| 33 const SkBitmap* icon = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | |
| 34 IDR_ACTION_BOX_BUTTON); | |
| 35 if (icon) | |
|
Aaron Boodman
2012/05/17 20:42:05
There's no case in which these icons won't be pres
yefimt
2012/05/17 22:42:52
Done.
| |
| 36 SetIcon(*icon); | |
| 37 icon = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | |
| 38 IDR_ACTION_BOX_BUTTON_H); | |
| 39 if (icon) | |
| 40 SetHoverIcon(*icon); | |
| 41 icon = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | |
| 42 IDR_ACTION_BOX_BUTTON_P); | |
| 43 if (icon) | |
| 44 SetPushedIcon(*icon); | |
| 45 } | |
| 46 | |
| 47 void ActionBoxButtonView::GetAccessibleState(ui::AccessibleViewState* state) { | |
| 48 MenuButton::GetAccessibleState(state); | |
| 49 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ACTION_BOX_BUTTON); | |
| 50 } | |
| 51 | |
| 52 void ActionBoxButtonView::OnMenuButtonClicked(View* source, | |
| 53 const gfx::Point& point) { | |
| 54 } | |
| 55 | |
| OLD | NEW |