| 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
|
|
|