| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
| 9 #include "chrome/browser/themes/theme_service_factory.h" | 9 #include "chrome/browser/themes/theme_service_factory.h" |
| 10 #include "chrome/browser/ui/layout_constants.h" | 10 #include "chrome/browser/ui/layout_constants.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 int frame_component = frame()->client_view()->NonClientHitTest(point); | 196 int frame_component = frame()->client_view()->NonClientHitTest(point); |
| 197 | 197 |
| 198 // See if we're in the sysmenu region. We still have to check the tabstrip | 198 // See if we're in the sysmenu region. We still have to check the tabstrip |
| 199 // first so that clicks in a tab don't get treated as sysmenu clicks. | 199 // first so that clicks in a tab don't get treated as sysmenu clicks. |
| 200 gfx::Rect sysmenu_rect(IconBounds()); | 200 gfx::Rect sysmenu_rect(IconBounds()); |
| 201 // In maximized mode we extend the rect to the screen corner to take advantage | 201 // In maximized mode we extend the rect to the screen corner to take advantage |
| 202 // of Fitts' Law. | 202 // of Fitts' Law. |
| 203 if (layout_->IsTitleBarCondensed()) | 203 if (layout_->IsTitleBarCondensed()) |
| 204 sysmenu_rect.SetRect(0, 0, sysmenu_rect.right(), sysmenu_rect.bottom()); | 204 sysmenu_rect.SetRect(0, 0, sysmenu_rect.right(), sysmenu_rect.bottom()); |
| 205 sysmenu_rect.set_x(GetMirroredXForRect(sysmenu_rect)); | 205 sysmenu_rect = GetMirroredRect(sysmenu_rect); |
| 206 if (sysmenu_rect.Contains(point)) | 206 if (sysmenu_rect.Contains(point)) |
| 207 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; | 207 return (frame_component == HTCLIENT) ? HTCLIENT : HTSYSMENU; |
| 208 | 208 |
| 209 if (frame_component != HTNOWHERE) | 209 if (frame_component != HTNOWHERE) |
| 210 return frame_component; | 210 return frame_component; |
| 211 | 211 |
| 212 // Then see if the point is within any of the window controls. | 212 // Then see if the point is within any of the window controls. |
| 213 if (close_button_ && close_button_->visible() && | 213 if (close_button_ && close_button_->visible() && |
| 214 close_button_->GetMirroredBounds().Contains(point)) | 214 close_button_->GetMirroredBounds().Contains(point)) |
| 215 return HTCLOSE; | 215 return HTCLOSE; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 y - GetTopInset(false) - GetLayoutInsets(TAB).top(), x, | 567 y - GetTopInset(false) - GetLayoutInsets(TAB).top(), x, |
| 568 y, w, toolbar_bounds.height()); | 568 y, w, toolbar_bounds.height()); |
| 569 } else { | 569 } else { |
| 570 canvas->FillRect(toolbar_bounds, | 570 canvas->FillRect(toolbar_bounds, |
| 571 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); | 571 tp->GetColor(ThemeProperties::COLOR_TOOLBAR)); |
| 572 } | 572 } |
| 573 | 573 |
| 574 // Top stroke. | 574 // Top stroke. |
| 575 gfx::Rect separator_rect(x, y, w, 0); | 575 gfx::Rect separator_rect(x, y, w, 0); |
| 576 gfx::ScopedCanvas scoped_canvas(canvas); | 576 gfx::ScopedCanvas scoped_canvas(canvas); |
| 577 gfx::Rect tabstrip_bounds(GetBoundsForTabStrip(browser_view()->tabstrip())); | 577 gfx::Rect tabstrip_bounds = |
| 578 tabstrip_bounds.set_x(GetMirroredXForRect(tabstrip_bounds)); | 578 GetMirroredRect(GetBoundsForTabStrip(browser_view()->tabstrip())); |
| 579 canvas->sk_canvas()->clipRect(gfx::RectToSkRect(tabstrip_bounds), | 579 canvas->sk_canvas()->clipRect(gfx::RectToSkRect(tabstrip_bounds), |
| 580 SkClipOp::kDifference); | 580 SkClipOp::kDifference); |
| 581 separator_rect.set_y(tabstrip_bounds.bottom()); | 581 separator_rect.set_y(tabstrip_bounds.bottom()); |
| 582 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), | 582 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), |
| 583 separator_rect, true); | 583 separator_rect, true); |
| 584 | 584 |
| 585 // Toolbar/content separator. | 585 // Toolbar/content separator. |
| 586 BrowserView::Paint1pxHorizontalLine( | 586 BrowserView::Paint1pxHorizontalLine( |
| 587 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 587 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| 588 toolbar_bounds, true); | 588 toolbar_bounds, true); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 gfx::Rect side(x, y, kClientEdgeThickness, h); | 663 gfx::Rect side(x, y, kClientEdgeThickness, h); |
| 664 canvas->FillRect(side, color); | 664 canvas->FillRect(side, color); |
| 665 if (draw_bottom) { | 665 if (draw_bottom) { |
| 666 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), | 666 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), |
| 667 kClientEdgeThickness), | 667 kClientEdgeThickness), |
| 668 color); | 668 color); |
| 669 } | 669 } |
| 670 side.Offset(w + kClientEdgeThickness, 0); | 670 side.Offset(w + kClientEdgeThickness, 0); |
| 671 canvas->FillRect(side, color); | 671 canvas->FillRect(side, color); |
| 672 } | 672 } |
| OLD | NEW |