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

Side by Side Diff: chrome/browser/views/frame/opaque_browser_frame_view.cc

Issue 150041: Theme window control buttons.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Theme window control buttons.... Created 11 years, 5 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 | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/tabs/tab_strip.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/frame/opaque_browser_frame_view.h" 5 #include "chrome/browser/views/frame/opaque_browser_frame_view.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/gfx/font.h" 8 #include "app/gfx/font.h"
9 #include "app/gfx/path.h" 9 #include "app/gfx/path.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 minimize_button_(new views::ImageButton(this)), 110 minimize_button_(new views::ImageButton(this)),
111 maximize_button_(new views::ImageButton(this)), 111 maximize_button_(new views::ImageButton(this)),
112 restore_button_(new views::ImageButton(this)), 112 restore_button_(new views::ImageButton(this)),
113 close_button_(new views::ImageButton(this)), 113 close_button_(new views::ImageButton(this)),
114 window_icon_(NULL), 114 window_icon_(NULL),
115 frame_(frame), 115 frame_(frame),
116 browser_view_(browser_view) { 116 browser_view_(browser_view) {
117 InitClass(); 117 InitClass();
118 118
119 ThemeProvider* tp = frame_->GetThemeProviderForFrame(); 119 ThemeProvider* tp = frame_->GetThemeProviderForFrame();
120 SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND);
121 SkBitmap* background =
122 tp->GetBitmapNamed(IDR_THEME_WINDOW_CONTROL_BACKGROUND);
120 123
121 minimize_button_->SetImage( 124 minimize_button_->SetImage(
122 views::CustomButton::BS_NORMAL, 125 views::CustomButton::BS_NORMAL,
123 tp->GetBitmapNamed(IDR_MINIMIZE)); 126 tp->GetBitmapNamed(IDR_MINIMIZE));
124 minimize_button_->SetImage( 127 minimize_button_->SetImage(
125 views::CustomButton::BS_HOT, 128 views::CustomButton::BS_HOT,
126 tp->GetBitmapNamed(IDR_MINIMIZE_H)); 129 tp->GetBitmapNamed(IDR_MINIMIZE_H));
127 minimize_button_->SetImage( 130 minimize_button_->SetImage(
128 views::CustomButton::BS_PUSHED, 131 views::CustomButton::BS_PUSHED,
129 tp->GetBitmapNamed(IDR_MINIMIZE_P)); 132 tp->GetBitmapNamed(IDR_MINIMIZE_P));
133 minimize_button_->SetBackground(color, background,
134 tp->GetBitmapNamed(IDR_MINIMIZE_BUTTON_MASK));
130 minimize_button_->SetAccessibleName( 135 minimize_button_->SetAccessibleName(
131 l10n_util::GetString(IDS_ACCNAME_MINIMIZE)); 136 l10n_util::GetString(IDS_ACCNAME_MINIMIZE));
132 AddChildView(minimize_button_); 137 AddChildView(minimize_button_);
133 138
134 maximize_button_->SetImage( 139 maximize_button_->SetImage(
135 views::CustomButton::BS_NORMAL, 140 views::CustomButton::BS_NORMAL,
136 tp->GetBitmapNamed(IDR_MAXIMIZE)); 141 tp->GetBitmapNamed(IDR_MAXIMIZE));
137 maximize_button_->SetImage( 142 maximize_button_->SetImage(
138 views::CustomButton::BS_HOT, 143 views::CustomButton::BS_HOT,
139 tp->GetBitmapNamed(IDR_MAXIMIZE_H)); 144 tp->GetBitmapNamed(IDR_MAXIMIZE_H));
140 maximize_button_->SetImage( 145 maximize_button_->SetImage(
141 views::CustomButton::BS_PUSHED, 146 views::CustomButton::BS_PUSHED,
142 tp->GetBitmapNamed(IDR_MAXIMIZE_P)); 147 tp->GetBitmapNamed(IDR_MAXIMIZE_P));
148 maximize_button_->SetBackground(color, background,
149 tp->GetBitmapNamed(IDR_MAXIMIZE_BUTTON_MASK));
143 maximize_button_->SetAccessibleName( 150 maximize_button_->SetAccessibleName(
144 l10n_util::GetString(IDS_ACCNAME_MAXIMIZE)); 151 l10n_util::GetString(IDS_ACCNAME_MAXIMIZE));
145 AddChildView(maximize_button_); 152 AddChildView(maximize_button_);
146 153
147 restore_button_->SetImage( 154 restore_button_->SetImage(
148 views::CustomButton::BS_NORMAL, 155 views::CustomButton::BS_NORMAL,
149 tp->GetBitmapNamed(IDR_RESTORE)); 156 tp->GetBitmapNamed(IDR_RESTORE));
150 restore_button_->SetImage( 157 restore_button_->SetImage(
151 views::CustomButton::BS_HOT, 158 views::CustomButton::BS_HOT,
152 tp->GetBitmapNamed(IDR_RESTORE_H)); 159 tp->GetBitmapNamed(IDR_RESTORE_H));
153 restore_button_->SetImage( 160 restore_button_->SetImage(
154 views::CustomButton::BS_PUSHED, 161 views::CustomButton::BS_PUSHED,
155 tp->GetBitmapNamed(IDR_RESTORE_P)); 162 tp->GetBitmapNamed(IDR_RESTORE_P));
163 restore_button_->SetBackground(color, background,
164 tp->GetBitmapNamed(IDR_RESTORE_BUTTON_MASK));
156 restore_button_->SetAccessibleName( 165 restore_button_->SetAccessibleName(
157 l10n_util::GetString(IDS_ACCNAME_RESTORE)); 166 l10n_util::GetString(IDS_ACCNAME_RESTORE));
158 AddChildView(restore_button_); 167 AddChildView(restore_button_);
159 168
160 close_button_->SetImage( 169 close_button_->SetImage(
161 views::CustomButton::BS_NORMAL, 170 views::CustomButton::BS_NORMAL,
162 tp->GetBitmapNamed(IDR_CLOSE)); 171 tp->GetBitmapNamed(IDR_CLOSE));
163 close_button_->SetImage( 172 close_button_->SetImage(
164 views::CustomButton::BS_HOT, 173 views::CustomButton::BS_HOT,
165 tp->GetBitmapNamed(IDR_CLOSE_H)); 174 tp->GetBitmapNamed(IDR_CLOSE_H));
166 close_button_->SetImage( 175 close_button_->SetImage(
167 views::CustomButton::BS_PUSHED, 176 views::CustomButton::BS_PUSHED,
168 tp->GetBitmapNamed(IDR_CLOSE_P)); 177 tp->GetBitmapNamed(IDR_CLOSE_P));
178 close_button_->SetBackground(color, background,
179 tp->GetBitmapNamed(IDR_CLOSE_BUTTON_MASK));
169 close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE)); 180 close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE));
170 AddChildView(close_button_); 181 AddChildView(close_button_);
171 182
172 // Initializing the TabIconView is expensive, so only do it if we need to. 183 // Initializing the TabIconView is expensive, so only do it if we need to.
173 if (browser_view_->ShouldShowWindowIcon()) { 184 if (browser_view_->ShouldShowWindowIcon()) {
174 window_icon_ = new TabIconView(this); 185 window_icon_ = new TabIconView(this);
175 window_icon_->set_is_light(true); 186 window_icon_->set_is_light(true);
176 AddChildView(window_icon_); 187 AddChildView(window_icon_);
177 window_icon_->Update(); 188 window_icon_->Update();
178 } 189 }
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 if (!initialized) { 1006 if (!initialized) {
996 #if defined(OS_WIN) 1007 #if defined(OS_WIN)
997 title_font_ = new gfx::Font(win_util::GetWindowTitleFont()); 1008 title_font_ = new gfx::Font(win_util::GetWindowTitleFont());
998 #else 1009 #else
999 NOTIMPLEMENTED(); 1010 NOTIMPLEMENTED();
1000 title_font_ = new gfx::Font(); 1011 title_font_ = new gfx::Font();
1001 #endif 1012 #endif
1002 initialized = true; 1013 initialized = true;
1003 } 1014 }
1004 } 1015 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.cc ('k') | chrome/browser/views/tabs/tab_strip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698