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

Unified Diff: chrome/browser/views/theme_background.cc

Issue 535005: Don't theme app/popup window (Closed)
Patch Set: " Created 10 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/theme_background.cc
diff --git a/chrome/browser/views/theme_background.cc b/chrome/browser/views/theme_background.cc
index e1dc104d9983f5dbf9703a72e8577fa846a10218..8234e3a59f7cd126d4ee2c9b18906c8e49bdc0ef 100644
--- a/chrome/browser/views/theme_background.cc
+++ b/chrome/browser/views/theme_background.cc
@@ -5,9 +5,11 @@
#include "chrome/browser/views/theme_background.h"
#include "app/gfx/canvas.h"
+#include "app/resource_bundle.h"
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/views/frame/browser_view.h"
+#include "grit/app_resources.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "views/view.h"
@@ -17,17 +19,28 @@ ThemeBackground::ThemeBackground(BrowserView* browser_view)
}
void ThemeBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
- int image_name;
- Browser* browser = browser_view_->browser();
- if (browser->window()->IsActive()) {
- image_name = browser->profile()->IsOffTheRecord() ?
- IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME;
+ SkBitmap* background;
+
+ // Never theme app and popup windows.
+ if (!browser_view_->IsBrowserTypeNormal()) {
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+ if (browser_view_->IsActive())
+ background = rb.GetBitmapNamed(IDR_FRAME);
+ else
+ background = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
} else {
- image_name = browser->profile()->IsOffTheRecord() ?
- IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE;
+ Profile* profile = browser_view_->browser()->profile();
+ ThemeProvider* theme = profile->GetThemeProvider();
+ if (browser_view_->IsActive()) {
+ background = theme->GetBitmapNamed(
+ profile->IsOffTheRecord() ?
+ IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME);
+ } else {
+ background = theme->GetBitmapNamed(
+ profile->IsOffTheRecord() ?
+ IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE);
+ }
}
- ThemeProvider* theme = browser->profile()->GetThemeProvider();
- SkBitmap* background = theme->GetBitmapNamed(image_name);
gfx::Point origin(0, 0);
views::View::ConvertPointToView(view,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698