| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // The content left/right images have a shadow built into them. | 69 // The content left/right images have a shadow built into them. |
| 70 const int kContentEdgeShadowThickness = 2; | 70 const int kContentEdgeShadowThickness = 2; |
| 71 | 71 |
| 72 // The icon never shrinks below 16 px on a side. | 72 // The icon never shrinks below 16 px on a side. |
| 73 const int kIconMinimumSize = 16; | 73 const int kIconMinimumSize = 16; |
| 74 | 74 |
| 75 // The top 3 px of the tabstrip is shadow; in maximized mode we push this off | 75 // The top 3 px of the tabstrip is shadow; in maximized mode we push this off |
| 76 // the top of the screen so the tabs appear flush against the screen edge. | 76 // the top of the screen so the tabs appear flush against the screen edge. |
| 77 const int kTabstripTopShadowThickness = 3; | 77 const int kTabstripTopShadowThickness = 3; |
| 78 | 78 |
| 79 // Converts |bounds| from |src|'s coordinate system to |dst|, and checks if | |
| 80 // |pt| is contained within. | |
| 81 bool ConvertedContainsCheck(gfx::Rect bounds, const views::View* src, | |
| 82 const views::View* dst, const gfx::Point& pt) { | |
| 83 DCHECK(src); | |
| 84 DCHECK(dst); | |
| 85 gfx::Point origin(bounds.origin()); | |
| 86 views::View::ConvertPointToTarget(src, dst, &origin); | |
| 87 bounds.set_origin(origin); | |
| 88 return bounds.Contains(pt); | |
| 89 } | |
| 90 | |
| 91 } // namespace | 79 } // namespace |
| 92 | 80 |
| 93 /////////////////////////////////////////////////////////////////////////////// | 81 /////////////////////////////////////////////////////////////////////////////// |
| 94 // OpaqueBrowserFrameView, public: | 82 // OpaqueBrowserFrameView, public: |
| 95 | 83 |
| 96 OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame, | 84 OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame, |
| 97 BrowserView* browser_view) | 85 BrowserView* browser_view) |
| 98 : BrowserNonClientFrameView(frame, browser_view), | 86 : BrowserNonClientFrameView(frame, browser_view), |
| 99 layout_(new OpaqueBrowserFrameViewLayout(this)), | 87 layout_(new OpaqueBrowserFrameViewLayout(this)), |
| 100 minimize_button_(NULL), | 88 minimize_button_(NULL), |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 | 867 |
| 880 int OpaqueBrowserFrameView::GetTopAreaHeight() const { | 868 int OpaqueBrowserFrameView::GetTopAreaHeight() const { |
| 881 gfx::ImageSkia* frame_image = GetFrameImage(); | 869 gfx::ImageSkia* frame_image = GetFrameImage(); |
| 882 int top_area_height = frame_image->height(); | 870 int top_area_height = frame_image->height(); |
| 883 if (browser_view()->IsTabStripVisible()) { | 871 if (browser_view()->IsTabStripVisible()) { |
| 884 top_area_height = std::max(top_area_height, | 872 top_area_height = std::max(top_area_height, |
| 885 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); | 873 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); |
| 886 } | 874 } |
| 887 return top_area_height; | 875 return top_area_height; |
| 888 } | 876 } |
| OLD | NEW |