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

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
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 18 matching lines...) Expand all
29 } // namespace 29 } // namespace
30 30
31 31
32 ActionBoxButtonView::ActionBoxButtonView(Browser* browser) 32 ActionBoxButtonView::ActionBoxButtonView(Browser* browser)
33 : views::MenuButton(NULL, string16(), this, false), 33 : views::MenuButton(NULL, string16(), this, false),
34 browser_(browser) { 34 browser_(browser) {
35 set_id(VIEW_ID_ACTION_BOX_BUTTON); 35 set_id(VIEW_ID_ACTION_BOX_BUTTON);
36 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON)); 36 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_ACTION_BOX_BUTTON));
37 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 37 SetIcon(*ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
38 IDR_ACTION_BOX_BUTTON)); 38 IDR_ACTION_BOX_BUTTON));
39 set_icon_placement(ICON_CENTERED);
39 set_accessibility_focusable(true); 40 set_accessibility_focusable(true);
40 set_border(NULL); 41 set_border(NULL);
41 } 42 }
42 43
43 ActionBoxButtonView::~ActionBoxButtonView() { 44 ActionBoxButtonView::~ActionBoxButtonView() {
44 } 45 }
45 46
46 SkColor ActionBoxButtonView::GetBackgroundColor() { 47 SkColor ActionBoxButtonView::GetBackgroundColor() {
47 switch (state()) { 48 switch (state()) {
48 case BS_PUSHED: 49 case BS_PUSHED:
(...skipping 21 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') | ui/views/controls/button/text_button.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698