Commit a3beea09 authored by mirandac@chromium.org's avatar mirandac@chromium.org

Fix problem of white box appearing in themes without an NTP background image.

BUG= http://crbug.com/21290
TEST= Install a theme without an NTP image (greyscale).  Look at NTP with bookmarkbar attached and detached.  See no white box at bottom of NTP.

Review URL: http://codereview.chromium.org/194066

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25861 0039d316-1c4b-4281-b951-d872f2087c98
parent 25a8dba0
...@@ -256,6 +256,13 @@ BrowserThemeProvider::BrowserThemeProvider() ...@@ -256,6 +256,13 @@ BrowserThemeProvider::BrowserThemeProvider()
resource_names_[IDR_THEME_TAB_BACKGROUND] = "theme_tab_background"; resource_names_[IDR_THEME_TAB_BACKGROUND] = "theme_tab_background";
resource_names_[IDR_THEME_TAB_BACKGROUND_INCOGNITO] = resource_names_[IDR_THEME_TAB_BACKGROUND_INCOGNITO] =
"theme_tab_background_incognito"; "theme_tab_background_incognito";
resource_names_[IDR_THEME_TOOLBAR] = "theme_toolbar";
resource_names_[IDR_THEME_TAB_BACKGROUND_V] = "theme_tab_background_v";
resource_names_[IDR_THEME_NTP_BACKGROUND] = "theme_ntp_background";
resource_names_[IDR_THEME_BUTTON_BACKGROUND] = "theme_button_background";
resource_names_[IDR_THEME_NTP_ATTRIBUTION] = "theme_ntp_attribution";
resource_names_[IDR_THEME_WINDOW_CONTROL_BACKGROUND] =
"theme_window_control_background";
} }
} }
......
...@@ -255,6 +255,14 @@ std::string DOMUIThemeSource::GetNewTabBackgroundCSS(bool bar_attached) { ...@@ -255,6 +255,14 @@ std::string DOMUIThemeSource::GetNewTabBackgroundCSS(bool bar_attached) {
profile_->GetThemeProvider()->GetDisplayProperty( profile_->GetThemeProvider()->GetDisplayProperty(
BrowserThemeProvider::NTP_BACKGROUND_ALIGNMENT, &alignment); BrowserThemeProvider::NTP_BACKGROUND_ALIGNMENT, &alignment);
// TODO(glen): This is a quick workaround to hide the notused.png image when
// no image is provided - we don't have time right now to figure out why
// this is painting as white.
// http://crbug.com/17593
if (!profile_->GetThemeProvider()->HasCustomImage(IDR_THEME_NTP_BACKGROUND)) {
return "-64px";
}
if (bar_attached) if (bar_attached)
return BrowserThemeProvider::AlignmentToString(alignment); return BrowserThemeProvider::AlignmentToString(alignment);
...@@ -266,14 +274,6 @@ std::string DOMUIThemeSource::GetNewTabBackgroundCSS(bool bar_attached) { ...@@ -266,14 +274,6 @@ std::string DOMUIThemeSource::GetNewTabBackgroundCSS(bool bar_attached) {
int offset = 0; int offset = 0;
#endif #endif
// TODO(glen): This is a quick workaround to hide the notused.png image when
// no image is provided - we don't have time right now to figure out why
// this is painting as white.
// http://crbug.com/17593
if (!profile_->GetThemeProvider()->HasCustomImage(IDR_THEME_NTP_BACKGROUND)) {
return "-64px";
}
if (alignment & BrowserThemeProvider::ALIGN_TOP) { if (alignment & BrowserThemeProvider::ALIGN_TOP) {
if (alignment & BrowserThemeProvider::ALIGN_LEFT) if (alignment & BrowserThemeProvider::ALIGN_LEFT)
return "0% " + IntToString(-offset) + "px"; return "0% " + IntToString(-offset) + "px";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment