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_NON_CLIENT_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_NON_CLIENT_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 "ui/views/window/non_client_view.h" |
10 | 10 |
11 namespace aura { | 11 namespace ash { |
12 class Window; | 12 class HideableCaptionButtonContainer; |
13 } | 13 } |
14 | 14 |
15 namespace ash { | 15 namespace views { |
16 class FrameCaptionButtonContainerView; | 16 class Widget; |
17 } | 17 } |
18 | 18 |
19 // NonClientFrameViewAsh implementation for maximized apps. | 19 // NonClientFrameView implementation for maximized apps. |
20 class AppNonClientFrameViewAsh : public BrowserNonClientFrameView { | 20 class AppNonClientFrameViewAsh : public views::NonClientFrameView { |
21 public: | 21 public: |
22 static const char kViewClassName[]; // visible for test | 22 static const char kViewClassName[]; // visible for test |
23 static const char kControlWindowName[]; // visible for test | |
24 | 23 |
25 AppNonClientFrameViewAsh( | 24 explicit AppNonClientFrameViewAsh(views::Widget* frame); |
26 BrowserFrame* frame, BrowserView* browser_view); | |
27 virtual ~AppNonClientFrameViewAsh(); | 25 virtual ~AppNonClientFrameViewAsh(); |
28 | 26 |
29 // NonClientFrameView: | 27 // NonClientFrameView: |
30 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 28 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
31 virtual gfx::Rect GetWindowBoundsForClientBounds( | 29 virtual gfx::Rect GetWindowBoundsForClientBounds( |
32 const gfx::Rect& client_bounds) const OVERRIDE; | 30 const gfx::Rect& client_bounds) const OVERRIDE; |
33 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 31 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
34 virtual void GetWindowMask( | 32 virtual void GetWindowMask( |
35 const gfx::Size& size, | 33 const gfx::Size& size, |
36 gfx::Path* window_mask) OVERRIDE; | 34 gfx::Path* window_mask) OVERRIDE; |
37 virtual void ResetWindowControls() OVERRIDE; | 35 virtual void ResetWindowControls() OVERRIDE; |
38 virtual void UpdateWindowIcon() OVERRIDE; | 36 virtual void UpdateWindowIcon() OVERRIDE; |
39 virtual void UpdateWindowTitle() OVERRIDE; | 37 virtual void UpdateWindowTitle() OVERRIDE; |
40 | 38 |
41 // BrowserNonClientFrameView: | |
42 virtual gfx::Rect GetBoundsForTabStrip( | |
43 views::View* tabstrip) const OVERRIDE; | |
44 virtual TabStripInsets GetTabStripInsets(bool restored) const OVERRIDE; | |
45 virtual int GetThemeBackgroundXInset() const OVERRIDE; | |
46 virtual void UpdateThrobber(bool running) OVERRIDE; | |
47 | |
48 // views::View: | 39 // views::View: |
49 virtual const char* GetClassName() const OVERRIDE; | 40 virtual const char* GetClassName() const OVERRIDE; |
50 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | |
51 | 41 |
52 private: | 42 private: |
53 class FrameObserver; | 43 scoped_ptr<ash::HideableCaptionButtonContainer> container_; |
54 | |
55 gfx::Rect GetControlBounds() const; | |
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 | 44 |
67 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAsh); | 45 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAsh); |
68 }; | 46 }; |
69 | 47 |
70 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ | 48 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_ASH_H_ |
OLD | NEW |