| 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 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/panels/panel_constants.h" | 8 #include "chrome/browser/ui/panels/panel_constants.h" |
| 9 #include "chrome/browser/ui/views/tab_icon_view_model.h" | 9 #include "chrome/browser/ui/views/tab_icon_view_model.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public chrome::TabIconViewModel { | 23 public chrome::TabIconViewModel { |
| 24 public: | 24 public: |
| 25 enum PaintState { | 25 enum PaintState { |
| 26 PAINT_AS_INACTIVE, | 26 PAINT_AS_INACTIVE, |
| 27 PAINT_AS_ACTIVE, | 27 PAINT_AS_ACTIVE, |
| 28 PAINT_AS_MINIMIZED, | 28 PAINT_AS_MINIMIZED, |
| 29 PAINT_FOR_ATTENTION | 29 PAINT_FOR_ATTENTION |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 explicit PanelFrameView(PanelView* panel_view); | 32 explicit PanelFrameView(PanelView* panel_view); |
| 33 virtual ~PanelFrameView(); | 33 ~PanelFrameView() override; |
| 34 | 34 |
| 35 void Init(); | 35 void Init(); |
| 36 void UpdateTitle(); | 36 void UpdateTitle(); |
| 37 void UpdateIcon(); | 37 void UpdateIcon(); |
| 38 void UpdateThrobber(); | 38 void UpdateThrobber(); |
| 39 void UpdateTitlebarMinimizeRestoreButtonVisibility(); | 39 void UpdateTitlebarMinimizeRestoreButtonVisibility(); |
| 40 void SetWindowCornerStyle(panel::CornerStyle corner_style); | 40 void SetWindowCornerStyle(panel::CornerStyle corner_style); |
| 41 | 41 |
| 42 // Returns the size of the non-client area, that is, the window size minus | 42 // Returns the size of the non-client area, that is, the window size minus |
| 43 // the size of the client area. | 43 // the size of the client area. |
| 44 gfx::Size NonClientAreaSize() const; | 44 gfx::Size NonClientAreaSize() const; |
| 45 | 45 |
| 46 int BorderThickness() const; | 46 int BorderThickness() const; |
| 47 | 47 |
| 48 PaintState GetPaintState() const; | 48 PaintState GetPaintState() const; |
| 49 | 49 |
| 50 views::ImageButton* close_button() const { return close_button_; } | 50 views::ImageButton* close_button() const { return close_button_; } |
| 51 views::ImageButton* minimize_button() const { return minimize_button_; } | 51 views::ImageButton* minimize_button() const { return minimize_button_; } |
| 52 views::ImageButton* restore_button() const { return restore_button_; } | 52 views::ImageButton* restore_button() const { return restore_button_; } |
| 53 TabIconView* title_icon() const { return title_icon_; } | 53 TabIconView* title_icon() const { return title_icon_; } |
| 54 views::Label* title_label() const { return title_label_; } | 54 views::Label* title_label() const { return title_label_; } |
| 55 panel::CornerStyle corner_style() const { return corner_style_; } | 55 panel::CornerStyle corner_style() const { return corner_style_; } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // Overridden from views::NonClientFrameView: | 58 // Overridden from views::NonClientFrameView: |
| 59 virtual gfx::Rect GetBoundsForClientView() const override; | 59 gfx::Rect GetBoundsForClientView() const override; |
| 60 virtual gfx::Rect GetWindowBoundsForClientBounds( | 60 gfx::Rect GetWindowBoundsForClientBounds( |
| 61 const gfx::Rect& client_bounds) const override; | 61 const gfx::Rect& client_bounds) const override; |
| 62 virtual int NonClientHitTest(const gfx::Point& point) override; | 62 int NonClientHitTest(const gfx::Point& point) override; |
| 63 virtual void GetWindowMask(const gfx::Size& size, | 63 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 64 gfx::Path* window_mask) override; | 64 void ResetWindowControls() override; |
| 65 virtual void ResetWindowControls() override; | 65 void UpdateWindowIcon() override; |
| 66 virtual void UpdateWindowIcon() override; | 66 void UpdateWindowTitle() override; |
| 67 virtual void UpdateWindowTitle() override; | 67 void SizeConstraintsChanged() override; |
| 68 virtual void SizeConstraintsChanged() override; | |
| 69 | 68 |
| 70 // Overridden from views::View: | 69 // Overridden from views::View: |
| 71 virtual gfx::Size GetPreferredSize() const override; | 70 gfx::Size GetPreferredSize() const override; |
| 72 virtual const char* GetClassName() const override; | 71 const char* GetClassName() const override; |
| 73 virtual gfx::Size GetMinimumSize() const override; | 72 gfx::Size GetMinimumSize() const override; |
| 74 virtual gfx::Size GetMaximumSize() const override; | 73 gfx::Size GetMaximumSize() const override; |
| 75 virtual void Layout() override; | 74 void Layout() override; |
| 76 virtual void OnPaint(gfx::Canvas* canvas) override; | 75 void OnPaint(gfx::Canvas* canvas) override; |
| 77 virtual bool OnMousePressed(const ui::MouseEvent& event) override; | 76 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 78 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; | 77 bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 79 virtual void OnMouseReleased(const ui::MouseEvent& event) override; | 78 void OnMouseReleased(const ui::MouseEvent& event) override; |
| 80 virtual void OnMouseCaptureLost() override; | 79 void OnMouseCaptureLost() override; |
| 81 | 80 |
| 82 // Overridden from views::ButtonListener: | 81 // Overridden from views::ButtonListener: |
| 83 virtual void ButtonPressed(views::Button* sender, const ui::Event& event) | 82 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 84 override; | |
| 85 | 83 |
| 86 // Overridden from chrome::TabIconViewModel: | 84 // Overridden from chrome::TabIconViewModel: |
| 87 virtual bool ShouldTabIconViewAnimate() const override; | 85 bool ShouldTabIconViewAnimate() const override; |
| 88 virtual gfx::ImageSkia GetFaviconForTabIconView() override; | 86 gfx::ImageSkia GetFaviconForTabIconView() override; |
| 89 | 87 |
| 90 int TitlebarHeight() const; | 88 int TitlebarHeight() const; |
| 91 | 89 |
| 92 const gfx::ImageSkia* GetFrameBackground(PaintState paint_state) const; | 90 const gfx::ImageSkia* GetFrameBackground(PaintState paint_state) const; |
| 93 | 91 |
| 94 // Update control styles to indicate if the titlebar is active or not. | 92 // Update control styles to indicate if the titlebar is active or not. |
| 95 void UpdateControlStyles(PaintState paint_state); | 93 void UpdateControlStyles(PaintState paint_state); |
| 96 | 94 |
| 97 // Custom draw the frame. | 95 // Custom draw the frame. |
| 98 void PaintFrameBackground(gfx::Canvas* canvas); | 96 void PaintFrameBackground(gfx::Canvas* canvas); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 112 views::ImageButton* minimize_button_; | 110 views::ImageButton* minimize_button_; |
| 113 views::ImageButton* restore_button_; | 111 views::ImageButton* restore_button_; |
| 114 TabIconView* title_icon_; | 112 TabIconView* title_icon_; |
| 115 views::Label* title_label_; | 113 views::Label* title_label_; |
| 116 panel::CornerStyle corner_style_; | 114 panel::CornerStyle corner_style_; |
| 117 | 115 |
| 118 DISALLOW_COPY_AND_ASSIGN(PanelFrameView); | 116 DISALLOW_COPY_AND_ASSIGN(PanelFrameView); |
| 119 }; | 117 }; |
| 120 | 118 |
| 121 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ | 119 #endif // CHROME_BROWSER_UI_VIEWS_PANELS_PANEL_FRAME_VIEW_H_ |
| OLD | NEW |