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

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

Issue 10662032: alternate ntp (cros/partial-win): add tab-related stuff and toolbar/tab background change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed scott's comments Created 8 years, 6 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
Index: chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index 9ab93066ee8bc3d76a6e0c8709adb49c63f971f7..404cfcf622433f091ee0cb560164ffeced6a9a38 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -12,6 +12,9 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/search/search.h"
+#include "chrome/browser/ui/search/search_model.h"
#include "chrome/browser/ui/views/avatar_menu_button.h"
#include "chrome/browser/ui/views/frame/browser_frame.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
@@ -647,12 +650,20 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
h));
canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
+ // TODO(kuan): migrate background animation from cros to win by calling
+ // GetToolbarBackgound* with the correct mode, refer to
+ // BrowserNonClientFrameViewAsh.
+ SkColor background_color = browser_view()->GetToolbarBackgroundColor(
+ browser_view()->browser()->search_model()->mode().mode);
+ gfx::ImageSkia* theme_toolbar = browser_view()->GetToolbarBackgroundImage(
+ browser_view()->browser()->search_model()->mode().mode);
+
+ // Paint the bottom rect.
canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height),
- tp->GetColor(ThemeService::COLOR_TOOLBAR));
+ background_color);
// Tile the toolbar image starting at the frame edge on the left and where the
// horizontal tabstrip is (or would be) on the top.
- gfx::ImageSkia* theme_toolbar = tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
canvas->TileImageInt(*theme_toolbar, x,
bottom_y - GetHorizontalTabStripVerticalOffset(false), x,
bottom_y, w, theme_toolbar->height());
@@ -713,12 +724,22 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) {
bottom_edge_height, right_x, bottom_y, toolbar_right->width(),
bottom_edge_height, false);
- // Draw the content/toolbar separator.
- canvas->FillRect(gfx::Rect(x + kClientEdgeThickness,
- toolbar_bounds.bottom() - kClientEdgeThickness,
- w - (2 * kClientEdgeThickness),
- kClientEdgeThickness),
- ThemeService::GetDefaultColor(ThemeService::COLOR_TOOLBAR_SEPARATOR));
+ // Only draw the content/toolbar separator if Instant Extended API is disabled
+ // or mode is DEFAULT.
+ Browser* browser = browser_view()->browser();
+ bool extended_instant_enabled = chrome::search::IsInstantExtendedAPIEnabled(
+ browser->profile());
+ if (!extended_instant_enabled ||
+ browser->search_model()->mode().is_default()) {
+ canvas->FillRect(
+ gfx::Rect(x + kClientEdgeThickness,
+ toolbar_bounds.bottom() - kClientEdgeThickness,
+ w - (2 * kClientEdgeThickness),
+ kClientEdgeThickness),
+ ThemeService::GetDefaultColor(extended_instant_enabled ?
+ ThemeService::COLOR_SEARCH_SEPARATOR_LINE :
+ ThemeService::COLOR_TOOLBAR_SEPARATOR));
+ }
}
void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
@@ -727,7 +748,8 @@ void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) {
int image_top = client_area_top;
gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height());
- SkColor toolbar_color = tp->GetColor(ThemeService::COLOR_TOOLBAR);
+ SkColor toolbar_color = browser_view()->GetToolbarBackgroundColor(
+ browser_view()->browser()->search_model()->mode().mode);
if (browser_view()->IsToolbarVisible()) {
// The client edge images always start below the toolbar corner images. The
« no previous file with comments | « chrome/browser/ui/views/frame/glass_browser_frame_view.cc ('k') | chrome/browser/ui/views/tabs/browser_tab_strip_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698