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_AURA_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_ |
7 | 7 |
8 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 8 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
9 #include "ui/base/animation/animation_delegate.h" | 9 #include "ui/base/animation/animation_delegate.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
11 #include "ui/views/mouse_watcher.h" | 11 #include "ui/views/mouse_watcher.h" |
12 #include "ui/views/widget/widget.h" | 12 #include "ui/views/widget/widget_observer.h" |
13 | 13 |
14 namespace aura { | 14 namespace aura { |
15 class Window; | 15 class Window; |
16 } | 16 } |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class SlideAnimation; | 19 class SlideAnimation; |
20 } | 20 } |
21 | 21 |
22 // NonClientFrameViewAura implementation for apps. | 22 // NonClientFrameViewAura implementation for apps. |
23 class AppNonClientFrameViewAura : public BrowserNonClientFrameView, | 23 class AppNonClientFrameViewAura : public BrowserNonClientFrameView, |
24 public views::MouseWatcherListener, | 24 public views::MouseWatcherListener, |
25 public views::Widget::Observer { | 25 public views::WidgetObserver { |
26 public: | 26 public: |
27 AppNonClientFrameViewAura( | 27 AppNonClientFrameViewAura( |
28 BrowserFrame* frame, BrowserView* browser_view); | 28 BrowserFrame* frame, BrowserView* browser_view); |
29 virtual ~AppNonClientFrameViewAura(); | 29 virtual ~AppNonClientFrameViewAura(); |
30 | 30 |
31 // NonClientFrameView: | 31 // NonClientFrameView: |
32 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 32 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
33 virtual gfx::Rect GetWindowBoundsForClientBounds( | 33 virtual gfx::Rect GetWindowBoundsForClientBounds( |
34 const gfx::Rect& client_bounds) const OVERRIDE; | 34 const gfx::Rect& client_bounds) const OVERRIDE; |
35 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 35 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
36 virtual void GetWindowMask( | 36 virtual void GetWindowMask( |
37 const gfx::Size& size, | 37 const gfx::Size& size, |
38 gfx::Path* window_mask) OVERRIDE; | 38 gfx::Path* window_mask) OVERRIDE; |
39 virtual void ResetWindowControls() OVERRIDE; | 39 virtual void ResetWindowControls() OVERRIDE; |
40 virtual void UpdateWindowIcon() OVERRIDE; | 40 virtual void UpdateWindowIcon() OVERRIDE; |
41 | 41 |
42 // BrowserNonClientFrameView: | 42 // BrowserNonClientFrameView: |
43 virtual gfx::Rect GetBoundsForTabStrip( | 43 virtual gfx::Rect GetBoundsForTabStrip( |
44 views::View* tabstrip) const OVERRIDE; | 44 views::View* tabstrip) const OVERRIDE; |
45 virtual TabStripInsets GetTabStripInsets(bool restored) const OVERRIDE; | 45 virtual TabStripInsets GetTabStripInsets(bool restored) const OVERRIDE; |
46 virtual void UpdateThrobber(bool running) OVERRIDE; | 46 virtual void UpdateThrobber(bool running) OVERRIDE; |
47 | 47 |
48 // View: | 48 // View: |
49 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; | 49 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE; |
50 | 50 |
51 // views::MouseWatcherListener. | 51 // views::MouseWatcherListener. |
52 virtual void MouseMovedOutOfHost() OVERRIDE; | 52 virtual void MouseMovedOutOfHost() OVERRIDE; |
53 | 53 |
54 // views::Widget::Observer. | 54 // views::WidgetObserver. |
55 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 55 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
56 | 56 |
57 // Close the app window. | 57 // Close the app window. |
58 void Close(); | 58 void Close(); |
59 | 59 |
60 // Restore the app window (will result in switching the frame_view back). | 60 // Restore the app window (will result in switching the frame_view back). |
61 void Restore(); | 61 void Restore(); |
62 | 62 |
63 // Returns true if the app controls are being displayed. | 63 // Returns true if the app controls are being displayed. |
64 bool IsShowingControls() const; | 64 bool IsShowingControls() const; |
(...skipping 14 matching lines...) Expand all Loading... |
79 views::Widget* control_widget_; | 79 views::Widget* control_widget_; |
80 // Tracks the mouse and causes the controls to slide back up when it exits. | 80 // Tracks the mouse and causes the controls to slide back up when it exits. |
81 views::MouseWatcher mouse_watcher_; | 81 views::MouseWatcher mouse_watcher_; |
82 // Should controls be animated. | 82 // Should controls be animated. |
83 bool animate_controls_; | 83 bool animate_controls_; |
84 | 84 |
85 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAura); | 85 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAura); |
86 }; | 86 }; |
87 | 87 |
88 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_ | 88 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_ |
OLD | NEW |