| 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_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_APP_BROWSER_FRAME_VIEW_ASH_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_APP_BROWSER_FRAME_VIEW_ASH_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 10 | 10 |
| 11 namespace aura { | 11 namespace ash { |
| 12 class Window; | 12 class HideableCaptionButtonContainer; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ash { | 15 // BrowserNonClientFrameView implementation for maximized apps. |
| 16 class FrameCaptionButtonContainerView; | 16 class AppBrowserFrameViewAsh : public BrowserNonClientFrameView { |
| 17 } | |
| 18 | |
| 19 // NonClientFrameViewAsh implementation for maximized apps. | |
| 20 class AppNonClientFrameViewAsh : public BrowserNonClientFrameView { | |
| 21 public: | 17 public: |
| 22 static const char kViewClassName[]; // visible for test | 18 static const char kViewClassName[]; // visible for test |
| 23 static const char kControlWindowName[]; // visible for test | |
| 24 | 19 |
| 25 AppNonClientFrameViewAsh( | 20 AppBrowserFrameViewAsh( |
| 26 BrowserFrame* frame, BrowserView* browser_view); | 21 BrowserFrame* frame, BrowserView* browser_view); |
| 27 virtual ~AppNonClientFrameViewAsh(); | 22 virtual ~AppBrowserFrameViewAsh(); |
| 28 | 23 |
| 29 // NonClientFrameView: | 24 // NonClientFrameView: |
| 30 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 25 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
| 31 virtual gfx::Rect GetWindowBoundsForClientBounds( | 26 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 32 const gfx::Rect& client_bounds) const OVERRIDE; | 27 const gfx::Rect& client_bounds) const OVERRIDE; |
| 33 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 28 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
| 34 virtual void GetWindowMask( | 29 virtual void GetWindowMask( |
| 35 const gfx::Size& size, | 30 const gfx::Size& size, |
| 36 gfx::Path* window_mask) OVERRIDE; | 31 gfx::Path* window_mask) OVERRIDE; |
| 37 virtual void ResetWindowControls() OVERRIDE; | 32 virtual void ResetWindowControls() OVERRIDE; |
| 38 virtual void UpdateWindowIcon() OVERRIDE; | 33 virtual void UpdateWindowIcon() OVERRIDE; |
| 39 virtual void UpdateWindowTitle() OVERRIDE; | 34 virtual void UpdateWindowTitle() OVERRIDE; |
| 40 | 35 |
| 41 // BrowserNonClientFrameView: | 36 // BrowserNonClientFrameView: |
| 42 virtual gfx::Rect GetBoundsForTabStrip( | 37 virtual gfx::Rect GetBoundsForTabStrip( |
| 43 views::View* tabstrip) const OVERRIDE; | 38 views::View* tabstrip) const OVERRIDE; |
| 44 virtual TabStripInsets GetTabStripInsets(bool restored) const OVERRIDE; | 39 virtual TabStripInsets GetTabStripInsets(bool restored) const OVERRIDE; |
| 45 virtual int GetThemeBackgroundXInset() const OVERRIDE; | 40 virtual int GetThemeBackgroundXInset() const OVERRIDE; |
| 46 virtual void UpdateThrobber(bool running) OVERRIDE; | 41 virtual void UpdateThrobber(bool running) OVERRIDE; |
| 47 | 42 |
| 48 // views::View: | 43 // views::View: |
| 49 virtual const char* GetClassName() const OVERRIDE; | 44 virtual const char* GetClassName() const OVERRIDE; |
| 50 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | |
| 51 | 45 |
| 52 private: | 46 private: |
| 53 class FrameObserver; | 47 scoped_ptr<ash::HideableCaptionButtonContainer> container_; |
| 54 | 48 |
| 55 gfx::Rect GetControlBounds() const; | 49 DISALLOW_COPY_AND_ASSIGN(AppBrowserFrameViewAsh); |
| 56 | |
| 57 // Closes |control_widget_|. | |
| 58 void CloseControlWidget(); | |
| 59 | |
| 60 // The View containing the restore and close buttons. | |
| 61 ash::FrameCaptionButtonContainerView* control_view_; | |
| 62 // The widget holding the control_view_. | |
| 63 views::Widget* control_widget_; | |
| 64 // Observer for browser frame close. | |
| 65 scoped_ptr<FrameObserver> frame_observer_; | |
| 66 | |
| 67 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAsh); | |
| 68 }; | 50 }; |
| 69 | 51 |
| 70 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ | 52 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_BROWSER_FRAME_VIEW_ASH_H_ |
| OLD | NEW |