summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_instant_controller.cc
diff options
context:
space:
mode:
authorkuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-06 20:11:23 +0000
committerkuan@chromium.org <kuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-06 20:11:23 +0000
commit3870363e188f0fbf455278aaa0380882fe3096f1 (patch)
treea1be4666024f76a41f0d112998d74ba051345676 /chrome/browser/ui/browser_instant_controller.cc
parent19c64145305eff1938e7a3273bb5187305734577 (diff)
downloadchromium_src-3870363e188f0fbf455278aaa0380882fe3096f1.zip
chromium_src-3870363e188f0fbf455278aaa0380882fe3096f1.tar.gz
chromium_src-3870363e188f0fbf455278aaa0380882fe3096f1.tar.bz2
alternate ntp: undo theme image top offset for ntp when bookmark bar is unpinned
new look for unpinned bmb doesn't use theme image as background, so NTP should draw the entire theme image from top to bottom BUG=176280 TEST=verify per bug rpt Review URL: https://chromiumcodereview.appspot.com/12460009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_instant_controller.cc')
-rw-r--r--chrome/browser/ui/browser_instant_controller.cc22
1 files changed, 7 insertions, 15 deletions
diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc
index 26ebd50..0a32bba 100644
--- a/chrome/browser/ui/browser_instant_controller.cc
+++ b/chrome/browser/ui/browser_instant_controller.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
-#include "chrome/browser/ui/bookmarks/bookmark_bar_constants.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
@@ -198,10 +197,10 @@ void BrowserInstantController::TabDeactivated(content::WebContents* contents) {
instant_.TabDeactivated(contents);
}
-void BrowserInstantController::UpdateThemeInfo(bool parse_theme_info) {
+void BrowserInstantController::UpdateThemeInfo() {
// Update theme background info.
- // Initialize or re-parse |theme_info| if necessary.
- if (!initialized_theme_info_ || parse_theme_info)
+ // Initialize |theme_info| if necessary.
+ if (!initialized_theme_info_)
OnThemeChanged(ThemeServiceFactory::GetForProfile(profile()));
else
OnThemeChanged(NULL);
@@ -242,7 +241,7 @@ void BrowserInstantController::ModeChanged(const search::Mode& old_mode,
const search::Mode& new_mode) {
// If mode is now |NTP|, send theme-related information to Instant.
if (new_mode.is_ntp())
- UpdateThemeInfo(false);
+ UpdateThemeInfo();
instant_.SearchModeChanged(old_mode, new_mode);
}
@@ -292,19 +291,12 @@ void BrowserInstantController::OnThemeChanged(ThemeService* theme_service) {
}
// Set theme background image vertical alignment.
- if (alignment & ThemeProperties::ALIGN_TOP) {
+ if (alignment & ThemeProperties::ALIGN_TOP)
theme_info_.image_vertical_alignment = THEME_BKGRND_IMAGE_ALIGN_TOP;
-#if !defined(OS_ANDROID)
- // A detached bookmark bar will draw the top part of a top-aligned theme
- // image as its background, so offset the image by the bar height.
- if (browser_->bookmark_bar_state() == BookmarkBar::DETACHED)
- theme_info_.image_top_offset = -chrome::kNTPBookmarkBarHeight;
-#endif // !defined(OS_ANDROID)
- } else if (alignment & ThemeProperties::ALIGN_BOTTOM) {
+ else if (alignment & ThemeProperties::ALIGN_BOTTOM)
theme_info_.image_vertical_alignment = THEME_BKGRND_IMAGE_ALIGN_BOTTOM;
- } else { // ALIGN_CENTER
+ else // ALIGN_CENTER
theme_info_.image_vertical_alignment = THEME_BKGRND_IMAGE_ALIGN_CENTER;
- }
// Set theme background image tiling.
int tiling = 0;