OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h" |
6 | 6 |
7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
8 #include "ash/wm/workspace/frame_maximize_button.h" | 8 #include "ash/wm/workspace/frame_maximize_button.h" |
9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 BrowserNonClientFrameView::TabStripInsets | 200 BrowserNonClientFrameView::TabStripInsets |
201 BrowserNonClientFrameViewAsh::GetTabStripInsets(bool force_restored) const { | 201 BrowserNonClientFrameViewAsh::GetTabStripInsets(bool force_restored) const { |
202 int left = avatar_button() ? kAvatarSideSpacing + | 202 int left = avatar_button() ? kAvatarSideSpacing + |
203 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : | 203 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : |
204 kTabstripLeftSpacing; | 204 kTabstripLeftSpacing; |
205 int right = frame_painter_->GetRightInset() + kTabstripRightSpacing; | 205 int right = frame_painter_->GetRightInset() + kTabstripRightSpacing; |
206 return TabStripInsets(NonClientTopBorderHeight(force_restored), left, right); | 206 return TabStripInsets(NonClientTopBorderHeight(force_restored), left, right); |
207 } | 207 } |
208 | 208 |
| 209 int BrowserNonClientFrameViewAsh::GetThemeBackgroundXInset() const { |
| 210 return frame_painter_->GetThemeBackgroundXInset(); |
| 211 } |
| 212 |
209 void BrowserNonClientFrameViewAsh::UpdateThrobber(bool running) { | 213 void BrowserNonClientFrameViewAsh::UpdateThrobber(bool running) { |
210 if (window_icon_) | 214 if (window_icon_) |
211 window_icon_->Update(); | 215 window_icon_->Update(); |
212 } | 216 } |
213 | 217 |
214 /////////////////////////////////////////////////////////////////////////////// | 218 /////////////////////////////////////////////////////////////////////////////// |
215 // views::NonClientFrameView overrides: | 219 // views::NonClientFrameView overrides: |
216 | 220 |
217 gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForClientView() const { | 221 gfx::Rect BrowserNonClientFrameViewAsh::GetBoundsForClientView() const { |
218 int top_height = NonClientTopBorderHeight(false); | 222 int top_height = NonClientTopBorderHeight(false); |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 518 |
515 // Paint the main toolbar image. Since this image is also used to draw the | 519 // Paint the main toolbar image. Since this image is also used to draw the |
516 // tab background, we must use the tab strip offset to compute the image | 520 // tab background, we must use the tab strip offset to compute the image |
517 // source y position. If you have to debug this code use an image editor | 521 // source y position. If you have to debug this code use an image editor |
518 // to paint a diagonal line through the toolbar image and ensure it lines up | 522 // to paint a diagonal line through the toolbar image and ensure it lines up |
519 // across the tab and toolbar. | 523 // across the tab and toolbar. |
520 gfx::ImageSkia* theme_toolbar = | 524 gfx::ImageSkia* theme_toolbar = |
521 browser_view()->GetToolbarBackgroundImage(mode); | 525 browser_view()->GetToolbarBackgroundImage(mode); |
522 canvas->TileImageInt( | 526 canvas->TileImageInt( |
523 *theme_toolbar, | 527 *theme_toolbar, |
524 x, bottom_y - GetTabStripInsets(false).top, | 528 x + GetThemeBackgroundXInset(), |
| 529 bottom_y - GetTabStripInsets(false).top, |
525 x, bottom_y, | 530 x, bottom_y, |
526 w, theme_toolbar->height()); | 531 w, theme_toolbar->height()); |
527 | 532 |
528 // The content area line has a shadow that extends a couple of pixels above | 533 // The content area line has a shadow that extends a couple of pixels above |
529 // the toolbar bounds. | 534 // the toolbar bounds. |
530 const int kContentShadowHeight = 2; | 535 const int kContentShadowHeight = 2; |
531 gfx::ImageSkia* toolbar_top = tp->GetImageSkiaNamed( | 536 gfx::ImageSkia* toolbar_top = tp->GetImageSkiaNamed( |
532 chrome::search::IsInstantExtendedAPIEnabled( | 537 chrome::search::IsInstantExtendedAPIEnabled( |
533 browser_view()->browser()->profile()) ? | 538 browser_view()->browser()->profile()) ? |
534 IDR_TOOLBAR_SHADE_TOP_SEARCH : IDR_TOOLBAR_SHADE_TOP); | 539 IDR_TOOLBAR_SHADE_TOP_SEARCH : IDR_TOOLBAR_SHADE_TOP); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { | 604 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { |
600 ui::ThemeProvider* tp = GetThemeProvider(); | 605 ui::ThemeProvider* tp = GetThemeProvider(); |
601 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 606 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
602 browser_view()->IsBrowserTypeNormal() && | 607 browser_view()->IsBrowserTypeNormal() && |
603 !browser_view()->IsOffTheRecord()) { | 608 !browser_view()->IsOffTheRecord()) { |
604 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? | 609 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? |
605 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); | 610 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); |
606 } | 611 } |
607 return NULL; | 612 return NULL; |
608 } | 613 } |
OLD | NEW |