| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" | 8 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 9 #include "ui/views/layout/layout_manager.h" | 9 #include "ui/views/layout/layout_manager.h" |
| 10 #include "ui/views/window/frame_buttons.h" | 10 #include "ui/views/window/frame_buttons.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 // Calculates the position of the widgets in the opaque browser frame view. | 25 // Calculates the position of the widgets in the opaque browser frame view. |
| 26 // | 26 // |
| 27 // This is separated out for testing reasons. OpaqueBrowserFrameView has tight | 27 // This is separated out for testing reasons. OpaqueBrowserFrameView has tight |
| 28 // dependencies with Browser and classes that depend on Browser. | 28 // dependencies with Browser and classes that depend on Browser. |
| 29 class OpaqueBrowserFrameViewLayout : public views::LayoutManager { | 29 class OpaqueBrowserFrameViewLayout : public views::LayoutManager { |
| 30 public: | 30 public: |
| 31 explicit OpaqueBrowserFrameViewLayout( | 31 explicit OpaqueBrowserFrameViewLayout( |
| 32 OpaqueBrowserFrameViewLayoutDelegate* delegate); | 32 OpaqueBrowserFrameViewLayoutDelegate* delegate); |
| 33 virtual ~OpaqueBrowserFrameViewLayout(); | 33 ~OpaqueBrowserFrameViewLayout() override; |
| 34 | 34 |
| 35 // Whether we should add the (minimize,maximize,close) buttons. This should be | 35 // Whether we should add the (minimize,maximize,close) buttons. This should be |
| 36 // true if the buttons could be shown at any time in this session (see | 36 // true if the buttons could be shown at any time in this session (see |
| 37 // OpaqueBrowserFrameViewLayoutDelegate::ShouldShowCaptionButtons for whether | 37 // OpaqueBrowserFrameViewLayoutDelegate::ShouldShowCaptionButtons for whether |
| 38 // they are currently visible). | 38 // they are currently visible). |
| 39 static bool ShouldAddDefaultCaptionButtons(); | 39 static bool ShouldAddDefaultCaptionButtons(); |
| 40 | 40 |
| 41 // Configures the button ordering in the frame. | 41 // Configures the button ordering in the frame. |
| 42 void SetButtonOrdering( | 42 void SetButtonOrdering( |
| 43 const std::vector<views::FrameButton>& leading_buttons, | 43 const std::vector<views::FrameButton>& leading_buttons, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 // Adds a window caption button to either the leading or trailing side. | 135 // Adds a window caption button to either the leading or trailing side. |
| 136 void SetBoundsForButton(views::View* host, | 136 void SetBoundsForButton(views::View* host, |
| 137 views::ImageButton* button, | 137 views::ImageButton* button, |
| 138 ButtonAlignment align, | 138 ButtonAlignment align, |
| 139 int caption_y); | 139 int caption_y); |
| 140 | 140 |
| 141 // Internal implementation of ViewAdded() and ViewRemoved(). | 141 // Internal implementation of ViewAdded() and ViewRemoved(). |
| 142 void SetView(int id, views::View* view); | 142 void SetView(int id, views::View* view); |
| 143 | 143 |
| 144 // Overriden from views::LayoutManager: | 144 // Overriden from views::LayoutManager: |
| 145 virtual void Layout(views::View* host) override; | 145 void Layout(views::View* host) override; |
| 146 virtual gfx::Size GetPreferredSize(const views::View* host) const override; | 146 gfx::Size GetPreferredSize(const views::View* host) const override; |
| 147 virtual void ViewAdded(views::View* host, views::View* view) override; | 147 void ViewAdded(views::View* host, views::View* view) override; |
| 148 virtual void ViewRemoved(views::View* host, views::View* view) override; | 148 void ViewRemoved(views::View* host, views::View* view) override; |
| 149 | 149 |
| 150 OpaqueBrowserFrameViewLayoutDelegate* delegate_; | 150 OpaqueBrowserFrameViewLayoutDelegate* delegate_; |
| 151 | 151 |
| 152 // The layout rect of the avatar icon, if visible. | 152 // The layout rect of the avatar icon, if visible. |
| 153 gfx::Rect avatar_bounds_; | 153 gfx::Rect avatar_bounds_; |
| 154 | 154 |
| 155 // The bounds of the ClientView. | 155 // The bounds of the ClientView. |
| 156 gfx::Rect client_view_bounds_; | 156 gfx::Rect client_view_bounds_; |
| 157 | 157 |
| 158 // The layout of the window icon, if visible. | 158 // The layout of the window icon, if visible. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 AvatarMenuButton* avatar_button_; | 194 AvatarMenuButton* avatar_button_; |
| 195 views::View* new_avatar_button_; | 195 views::View* new_avatar_button_; |
| 196 | 196 |
| 197 std::vector<views::FrameButton> leading_buttons_; | 197 std::vector<views::FrameButton> leading_buttons_; |
| 198 std::vector<views::FrameButton> trailing_buttons_; | 198 std::vector<views::FrameButton> trailing_buttons_; |
| 199 | 199 |
| 200 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameViewLayout); | 200 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameViewLayout); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ | 203 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_LAYOUT_H_ |
| OLD | NEW |