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

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

Issue 10933049: Fixed position of plus image on action box button; added ICON_CENTERED placement to TextButton (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | ui/views/controls/button/text_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/toolbar/action_box_menu_model.h" 9 #include "chrome/browser/ui/toolbar/action_box_menu_model.h"
10 #include "chrome/browser/ui/view_ids.h" 10 #include "chrome/browser/ui/view_ids.h"
(...skipping 17 matching lines...) Expand all
28 } // namespace 28 } // namespace
29 29
30 30
31 ActionBoxButtonView::ActionBoxButtonView(Browser* browser) 31 ActionBoxButtonView::ActionBoxButtonView(Browser* browser)
32 : views::MenuButton(NULL, string16(), this, false), 32 : views::MenuButton(NULL, string16(), this, false),
33 browser_(browser) { 33 browser_(browser) {
34 set_id(VIEW_ID_ACTION_BOX_BUTTON); 34 set_id(VIEW_ID_ACTION_BOX_BUTTON);
35 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); 35 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON));
36 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 36 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
37 IDR_ACTION_BOX_BUTTON)); 37 IDR_ACTION_BOX_BUTTON));
38 set_icon_placement(ICON_CENTERED);
38 set_accessibility_focusable(true); 39 set_accessibility_focusable(true);
39 set_border(NULL); 40 set_border(NULL);
40 } 41 }
41 42
42 ActionBoxButtonView::~ActionBoxButtonView() { 43 ActionBoxButtonView::~ActionBoxButtonView() {
43 } 44 }
44 45
45 SkColor ActionBoxButtonView::GetBackgroundColor() { 46 SkColor ActionBoxButtonView::GetBackgroundColor() {
46 switch (state()) { 47 switch (state()) {
47 case BS_PUSHED: 48 case BS_PUSHED:
(...skipping 22 matching lines...) Expand all
70 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ACTION_BOX_BUTTON); 71 state->name = l10n_util::GetStringUTF16(IDS_ACCNAME_ACTION_BOX_BUTTON);
71 } 72 }
72 73
73 void ActionBoxButtonView::OnMenuButtonClicked(View* source, 74 void ActionBoxButtonView::OnMenuButtonClicked(View* source,
74 const gfx::Point& point) { 75 const gfx::Point& point) {
75 ActionBoxMenuModel model(browser_); 76 ActionBoxMenuModel model(browser_);
76 ActionBoxMenu action_box_menu(browser_, &model); 77 ActionBoxMenu action_box_menu(browser_, &model);
77 action_box_menu.Init(); 78 action_box_menu.Init();
78 action_box_menu.RunMenu(this); 79 action_box_menu.RunMenu(this);
79 } 80 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/button/text_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698