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

Side by Side Diff: ui/views/controls/button/text_button.cc

Issue 10456077: ui: Rename the IDR constants to put hot/pressed state before position. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 "ui/views/controls/button/text_button.h" 5 #include "ui/views/controls/button/text_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 TextButtonBorder::TextButtonBorder() 84 TextButtonBorder::TextButtonBorder()
85 : vertical_padding_(kPreferredPaddingVertical) { 85 : vertical_padding_(kPreferredPaddingVertical) {
86 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 86 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
87 BorderImageSet normal_set = { 87 BorderImageSet normal_set = {
88 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 88 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
89 }; 89 };
90 set_normal_set(normal_set); 90 set_normal_set(normal_set);
91 91
92 BorderImageSet hot_set = { 92 BorderImageSet hot_set = {
93 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_LEFT_H).ToImageSkia(), 93 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_TOP_LEFT).ToImageSkia(),
94 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_H).ToImageSkia(), 94 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_TOP).ToImageSkia(),
95 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_RIGHT_H).ToImageSkia(), 95 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_TOP_RIGHT).ToImageSkia(),
96 rb.GetImageNamed(IDR_TEXTBUTTON_LEFT_H).ToImageSkia(), 96 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_LEFT).ToImageSkia(),
97 rb.GetImageNamed(IDR_TEXTBUTTON_CENTER_H).ToImageSkia(), 97 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_CENTER).ToImageSkia(),
98 rb.GetImageNamed(IDR_TEXTBUTTON_RIGHT_H).ToImageSkia(), 98 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_RIGHT).ToImageSkia(),
99 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_LEFT_H).ToImageSkia(), 99 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_BOTTOM_LEFT).ToImageSkia(),
100 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_H).ToImageSkia(), 100 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_BOTTOM).ToImageSkia(),
101 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_RIGHT_H).ToImageSkia(), 101 rb.GetImageNamed(IDR_TEXTBUTTON_HOT_BOTTOM_RIGHT).ToImageSkia(),
102 }; 102 };
103 set_hot_set(hot_set); 103 set_hot_set(hot_set);
104 104
105 BorderImageSet pushed_set = { 105 BorderImageSet pushed_set = {
106 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_LEFT_P).ToImageSkia(), 106 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_TOP_LEFT).ToImageSkia(),
107 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_P).ToImageSkia(), 107 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_TOP).ToImageSkia(),
108 rb.GetImageNamed(IDR_TEXTBUTTON_TOP_RIGHT_P).ToImageSkia(), 108 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_TOP_RIGHT).ToImageSkia(),
109 rb.GetImageNamed(IDR_TEXTBUTTON_LEFT_P).ToImageSkia(), 109 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_LEFT).ToImageSkia(),
110 rb.GetImageNamed(IDR_TEXTBUTTON_CENTER_P).ToImageSkia(), 110 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_CENTER).ToImageSkia(),
111 rb.GetImageNamed(IDR_TEXTBUTTON_RIGHT_P).ToImageSkia(), 111 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_RIGHT).ToImageSkia(),
112 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_LEFT_P).ToImageSkia(), 112 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_BOTTOM_LEFT).ToImageSkia(),
113 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_P).ToImageSkia(), 113 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_BOTTOM).ToImageSkia(),
114 rb.GetImageNamed(IDR_TEXTBUTTON_BOTTOM_RIGHT_P).ToImageSkia(), 114 rb.GetImageNamed(IDR_TEXTBUTTON_PRESSED_BOTTOM_RIGHT).ToImageSkia(),
115 }; 115 };
116 set_pushed_set(pushed_set); 116 set_pushed_set(pushed_set);
117 } 117 }
118 118
119 TextButtonBorder::~TextButtonBorder() { 119 TextButtonBorder::~TextButtonBorder() {
120 } 120 }
121 121
122 122
123 //////////////////////////////////////////////////////////////////////////////// 123 ////////////////////////////////////////////////////////////////////////////////
124 // 124 //
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 #endif 854 #endif
855 } 855 }
856 856
857 void NativeTextButton::GetExtraParams( 857 void NativeTextButton::GetExtraParams(
858 ui::NativeTheme::ExtraParams* params) const { 858 ui::NativeTheme::ExtraParams* params) const {
859 TextButton::GetExtraParams(params); 859 TextButton::GetExtraParams(params);
860 params->button.has_border = true; 860 params->button.has_border = true;
861 } 861 }
862 862
863 } // namespace views 863 } // namespace views
OLDNEW
« chrome/browser/ui/gtk/gtk_chrome_button.cc ('K') | « ui/resources/ui_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698