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

Unified Diff: chrome/browser/views/frame/opaque_browser_frame_view.cc

Issue 159871: Ensure that popup windows are not themed.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/frame/browser_frame_win.cc ('k') | views/window/non_client_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/opaque_browser_frame_view.cc
===================================================================
--- chrome/browser/views/frame/opaque_browser_frame_view.cc (revision 22523)
+++ chrome/browser/views/frame/opaque_browser_frame_view.cc (working copy)
@@ -125,7 +125,6 @@
SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND);
SkBitmap* background =
tp->GetBitmapNamed(IDR_THEME_WINDOW_CONTROL_BACKGROUND);
-
minimize_button_->SetImage(
views::CustomButton::BS_NORMAL,
tp->GetBitmapNamed(IDR_MINIMIZE));
@@ -135,8 +134,9 @@
minimize_button_->SetImage(
views::CustomButton::BS_PUSHED,
tp->GetBitmapNamed(IDR_MINIMIZE_P));
- minimize_button_->SetBackground(color, background,
- tp->GetBitmapNamed(IDR_MINIMIZE_BUTTON_MASK));
+ if (browser_view_->IsBrowserTypeNormal())
+ minimize_button_->SetBackground(color, background,
+ tp->GetBitmapNamed(IDR_MINIMIZE_BUTTON_MASK));
minimize_button_->SetAccessibleName(
l10n_util::GetString(IDS_ACCNAME_MINIMIZE));
AddChildView(minimize_button_);
@@ -150,8 +150,9 @@
maximize_button_->SetImage(
views::CustomButton::BS_PUSHED,
tp->GetBitmapNamed(IDR_MAXIMIZE_P));
- maximize_button_->SetBackground(color, background,
- tp->GetBitmapNamed(IDR_MAXIMIZE_BUTTON_MASK));
+ if (browser_view_->IsBrowserTypeNormal())
+ maximize_button_->SetBackground(color, background,
+ tp->GetBitmapNamed(IDR_MAXIMIZE_BUTTON_MASK));
maximize_button_->SetAccessibleName(
l10n_util::GetString(IDS_ACCNAME_MAXIMIZE));
AddChildView(maximize_button_);
@@ -165,8 +166,9 @@
restore_button_->SetImage(
views::CustomButton::BS_PUSHED,
tp->GetBitmapNamed(IDR_RESTORE_P));
- restore_button_->SetBackground(color, background,
- tp->GetBitmapNamed(IDR_RESTORE_BUTTON_MASK));
+ if (browser_view_->IsBrowserTypeNormal())
+ restore_button_->SetBackground(color, background,
+ tp->GetBitmapNamed(IDR_RESTORE_BUTTON_MASK));
restore_button_->SetAccessibleName(
l10n_util::GetString(IDS_ACCNAME_RESTORE));
AddChildView(restore_button_);
@@ -180,8 +182,9 @@
close_button_->SetImage(
views::CustomButton::BS_PUSHED,
tp->GetBitmapNamed(IDR_CLOSE_P));
- close_button_->SetBackground(color, background,
- tp->GetBitmapNamed(IDR_CLOSE_BUTTON_MASK));
+ if (browser_view_->IsBrowserTypeNormal())
+ close_button_->SetBackground(color, background,
+ tp->GetBitmapNamed(IDR_CLOSE_BUTTON_MASK));
close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE));
AddChildView(close_button_);
@@ -560,8 +563,23 @@
// Window frame mode and color
SkBitmap* theme_frame;
SkColor frame_color;
- if (!browser_view_->IsOffTheRecord()) {
+
+ // Never theme app and popup windows.
+ if (!browser_view_->IsBrowserTypeNormal()) {
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
if (frame_->GetWindow()->IsActive()) {
+ theme_frame = rb.GetBitmapNamed(IDR_FRAME);
+ frame_color = browser_view_->IsOffTheRecord() ?
+ ResourceBundle::frame_color_incognito :
+ ResourceBundle::frame_color;
+ } else {
+ theme_frame = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
+ frame_color = browser_view_->IsOffTheRecord() ?
+ ResourceBundle::frame_color_incognito_inactive :
+ ResourceBundle::frame_color_inactive;
+ }
+ } else if (!browser_view_->IsOffTheRecord()) {
+ if (frame_->GetWindow()->IsActive()) {
theme_frame = tp->GetBitmapNamed(IDR_THEME_FRAME);
frame_color = tp->GetColor(BrowserThemeProvider::COLOR_FRAME);
} else {
@@ -599,7 +617,8 @@
canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height());
// Draw the theme frame overlay
- if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) {
+ if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) &&
+ browser_view_->IsBrowserTypeNormal()) {
SkBitmap* theme_overlay;
if (frame_->GetWindow()->IsActive())
theme_overlay = tp->GetBitmapNamed(IDR_THEME_FRAME_OVERLAY);
@@ -654,7 +673,15 @@
// Window frame mode and color
SkBitmap* theme_frame;
- if (!browser_view_->IsOffTheRecord()) {
+
+ // Never theme app and popup windows.
+ if (!browser_view_->IsBrowserTypeNormal()) {
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ if (frame_->GetWindow()->IsActive())
+ theme_frame = rb.GetBitmapNamed(IDR_FRAME);
+ else
+ theme_frame = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
+ } else if (!browser_view_->IsOffTheRecord()) {
theme_frame = window->IsActive() ?
tp->GetBitmapNamed(IDR_THEME_FRAME) :
tp->GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
@@ -668,7 +695,8 @@
canvas->TileImageInt(*theme_frame, 0, 0, width(), theme_frame->height());
// Draw the theme frame overlay
- if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) {
+ if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) &&
+ browser_view_->IsBrowserTypeNormal()) {
SkBitmap* theme_overlay = tp->GetBitmapNamed(IDR_THEME_FRAME_OVERLAY);
canvas->DrawBitmapInt(*theme_overlay, 0, 0);
}
« no previous file with comments | « chrome/browser/views/frame/browser_frame_win.cc ('k') | views/window/non_client_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698