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

Side by Side Diff: chrome/browser/chromeos/status_area_view.cc

Issue 274070: Fix status area to use icognito mode background when in icognito mode.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 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/chromeos/compact_navigation_bar.cc ('k') | no next file » | 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/chromeos/status_area_view.h" 5 #include "chrome/browser/chromeos/status_area_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "app/gfx/canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 cur->SetBounds(cur_x, (height() - cur_size.height()) / 2 + 1, 175 cur->SetBounds(cur_x, (height() - cur_size.height()) / 2 + 1,
176 cur_size.width(), cur_size.height()); 176 cur_size.width(), cur_size.height());
177 cur_x += cur_size.width() + kStatusItemSeparation; 177 cur_x += cur_size.width() + kStatusItemSeparation;
178 } 178 }
179 } 179 }
180 180
181 void StatusAreaView::Paint(gfx::Canvas* canvas) { 181 void StatusAreaView::Paint(gfx::Canvas* canvas) {
182 ThemeProvider* theme = browser_->profile()->GetThemeProvider(); 182 ThemeProvider* theme = browser_->profile()->GetThemeProvider();
183 183
184 // Fill the background. 184 // Fill the background.
185 SkBitmap* background; 185 int image_name;
186 if (browser_->window()->IsActive()) 186 if (browser_->window()->IsActive()) {
187 background = theme->GetBitmapNamed(IDR_THEME_FRAME); 187 image_name = browser_->profile()->IsOffTheRecord() ?
188 else 188 IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME;
189 background = theme->GetBitmapNamed(IDR_THEME_FRAME_INACTIVE); 189 } else {
190 image_name = browser_->profile()->IsOffTheRecord() ?
191 IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE;
192 }
193 SkBitmap* background = theme->GetBitmapNamed(image_name);
190 canvas->TileImageInt( 194 canvas->TileImageInt(
191 *background, 195 *background,
192 0, kCustomFrameBackgroundVerticalOffset, 196 0, kCustomFrameBackgroundVerticalOffset,
193 0, 0, 197 0, 0,
194 width(), height()); 198 width(), height());
195 } 199 }
196 200
197 // static 201 // static
198 StatusAreaView::OpenTabsMode StatusAreaView::GetOpenTabsMode() { 202 StatusAreaView::OpenTabsMode StatusAreaView::GetOpenTabsMode() {
199 return open_tabs_mode_; 203 return open_tabs_mode_;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 267 }
264 268
265 void StatusAreaView::ExecuteCommand(int command_id) { 269 void StatusAreaView::ExecuteCommand(int command_id) {
266 browser_->ExecuteCommand(command_id); 270 browser_->ExecuteCommand(command_id);
267 } 271 }
268 272
269 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt) { 273 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt) {
270 CreateAppMenu(); 274 CreateAppMenu();
271 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); 275 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
272 } 276 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/compact_navigation_bar.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698