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/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 BrowserNonClientFrameView::TabStripInsets | 233 BrowserNonClientFrameView::TabStripInsets |
234 OpaqueBrowserFrameView::GetTabStripInsets(bool restored) const { | 234 OpaqueBrowserFrameView::GetTabStripInsets(bool restored) const { |
235 int top = NonClientTopBorderHeight(restored) + ((!restored && | 235 int top = NonClientTopBorderHeight(restored) + ((!restored && |
236 (frame()->IsMaximized() || | 236 (frame()->IsMaximized() || |
237 frame()->IsFullscreen())) ? | 237 frame()->IsFullscreen())) ? |
238 0 : kNonClientRestoredExtraThickness); | 238 0 : kNonClientRestoredExtraThickness); |
239 // TODO: include OTR and caption. | 239 // TODO: include OTR and caption. |
240 return TabStripInsets(top, 0, 0); | 240 return TabStripInsets(top, 0, 0); |
241 } | 241 } |
242 | 242 |
| 243 int OpaqueBrowserFrameView::GetThemeBackgroundXInset() const { |
| 244 return 0; |
| 245 } |
| 246 |
243 void OpaqueBrowserFrameView::UpdateThrobber(bool running) { | 247 void OpaqueBrowserFrameView::UpdateThrobber(bool running) { |
244 if (window_icon_) | 248 if (window_icon_) |
245 window_icon_->Update(); | 249 window_icon_->Update(); |
246 } | 250 } |
247 | 251 |
248 gfx::Size OpaqueBrowserFrameView::GetMinimumSize() { | 252 gfx::Size OpaqueBrowserFrameView::GetMinimumSize() { |
249 gfx::Size min_size(browser_view()->GetMinimumSize()); | 253 gfx::Size min_size(browser_view()->GetMinimumSize()); |
250 int border_thickness = NonClientBorderThickness(); | 254 int border_thickness = NonClientBorderThickness(); |
251 min_size.Enlarge(2 * border_thickness, | 255 min_size.Enlarge(2 * border_thickness, |
252 NonClientTopBorderHeight(false) + border_thickness); | 256 NonClientTopBorderHeight(false) + border_thickness); |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 browser_view()->browser()->search_model()->mode().mode); | 707 browser_view()->browser()->search_model()->mode().mode); |
704 gfx::ImageSkia* theme_toolbar = browser_view()->GetToolbarBackgroundImage( | 708 gfx::ImageSkia* theme_toolbar = browser_view()->GetToolbarBackgroundImage( |
705 browser_view()->browser()->search_model()->mode().mode); | 709 browser_view()->browser()->search_model()->mode().mode); |
706 | 710 |
707 // Paint the bottom rect. | 711 // Paint the bottom rect. |
708 canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height), | 712 canvas->FillRect(gfx::Rect(x, bottom_y, w, bottom_edge_height), |
709 background_color); | 713 background_color); |
710 | 714 |
711 // Tile the toolbar image starting at the frame edge on the left and where the | 715 // Tile the toolbar image starting at the frame edge on the left and where the |
712 // horizontal tabstrip is (or would be) on the top. | 716 // horizontal tabstrip is (or would be) on the top. |
713 canvas->TileImageInt(*theme_toolbar, x, | 717 canvas->TileImageInt(*theme_toolbar, |
714 bottom_y - GetTabStripInsets(false).top, x, | 718 x + GetThemeBackgroundXInset(), |
715 bottom_y, w, theme_toolbar->height()); | 719 bottom_y - GetTabStripInsets(false).top, |
| 720 x, bottom_y, w, theme_toolbar->height()); |
716 | 721 |
717 // Draw rounded corners for the tab. | 722 // Draw rounded corners for the tab. |
718 gfx::ImageSkia* toolbar_left_mask = | 723 gfx::ImageSkia* toolbar_left_mask = |
719 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); | 724 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); |
720 gfx::ImageSkia* toolbar_right_mask = | 725 gfx::ImageSkia* toolbar_right_mask = |
721 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); | 726 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); |
722 | 727 |
723 // We mask out the corners by using the DestinationIn transfer mode, | 728 // We mask out the corners by using the DestinationIn transfer mode, |
724 // which keeps the RGB pixels from the destination and the alpha from | 729 // which keeps the RGB pixels from the destination and the alpha from |
725 // the source. | 730 // the source. |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1031 | 1036 |
1032 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1037 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
1033 int height) const { | 1038 int height) const { |
1034 int top_height = NonClientTopBorderHeight(false); | 1039 int top_height = NonClientTopBorderHeight(false); |
1035 int border_thickness = NonClientBorderThickness(); | 1040 int border_thickness = NonClientBorderThickness(); |
1036 return gfx::Rect(border_thickness, top_height, | 1041 return gfx::Rect(border_thickness, top_height, |
1037 std::max(0, width - (2 * border_thickness)), | 1042 std::max(0, width - (2 * border_thickness)), |
1038 std::max(0, height - GetReservedHeight() - | 1043 std::max(0, height - GetReservedHeight() - |
1039 top_height - border_thickness)); | 1044 top_height - border_thickness)); |
1040 } | 1045 } |
OLD | NEW |