| 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 ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 5 #ifndef ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
| 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 6 #define ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
| 7 | 7 |
| 8 #include <map> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "ash/frame/caption_buttons/frame_size_button_delegate.h" | 11 #include "ash/frame/caption_buttons/frame_size_button_delegate.h" |
| 10 #include "ui/views/controls/button/button.h" | 12 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/view.h" | 13 #include "ui/views/view.h" |
| 12 | 14 |
| 13 namespace views { | 15 namespace views { |
| 14 class Widget; | 16 class Widget; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace ash { | 19 namespace ash { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 81 |
| 80 // Tell the window controls to reset themselves to the normal state. | 82 // Tell the window controls to reset themselves to the normal state. |
| 81 void ResetWindowControls(); | 83 void ResetWindowControls(); |
| 82 | 84 |
| 83 // Determines the window HT* code for the caption button at |point|. Returns | 85 // Determines the window HT* code for the caption button at |point|. Returns |
| 84 // HTNOWHERE if |point| is not over any of the caption buttons. |point| must | 86 // HTNOWHERE if |point| is not over any of the caption buttons. |point| must |
| 85 // be in the coordinates of the FrameCaptionButtonContainerView. | 87 // be in the coordinates of the FrameCaptionButtonContainerView. |
| 86 int NonClientHitTest(const gfx::Point& point) const; | 88 int NonClientHitTest(const gfx::Point& point) const; |
| 87 | 89 |
| 88 // Updates the size button's visibility based on whether |frame_| can be | 90 // Updates the size button's visibility based on whether |frame_| can be |
| 89 // maximized and |force_hidden|. A parent view should relayout to reflect the | 91 // maximized and is Maximize Mode is enabled. A parent view should relayout |
| 90 // change in visibility. | 92 // to reflect the change in visibility. |
| 91 void UpdateSizeButtonVisibility(bool force_hidden); | 93 void UpdateSizeButtonVisibility(); |
| 92 | 94 |
| 93 // views::View: | 95 // views::View: |
| 94 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 96 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| 95 virtual void Layout() OVERRIDE; | 97 virtual void Layout() OVERRIDE; |
| 96 virtual const char* GetClassName() const OVERRIDE; | 98 virtual const char* GetClassName() const OVERRIDE; |
| 97 | 99 |
| 98 private: | 100 private: |
| 99 friend class FrameCaptionButtonContainerViewTest; | 101 friend class FrameCaptionButtonContainerViewTest; |
| 100 | 102 |
| 101 struct ButtonIconIds { | 103 struct ButtonIconIds { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 FrameCaptionButton* size_button_; | 147 FrameCaptionButton* size_button_; |
| 146 FrameCaptionButton* close_button_; | 148 FrameCaptionButton* close_button_; |
| 147 | 149 |
| 148 // Mapping of the images needed to paint a button for each of the values of | 150 // Mapping of the images needed to paint a button for each of the values of |
| 149 // CaptionButtonIcon. | 151 // CaptionButtonIcon. |
| 150 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; | 152 std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_; |
| 151 | 153 |
| 152 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); | 154 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); |
| 153 }; | 155 }; |
| 154 | 156 |
| 155 } // namesapace ash | 157 } // namespace ash |
| 156 | 158 |
| 157 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ | 159 #endif // ASH_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ |
| OLD | NEW |