Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: chrome/browser/ui/views/frame/app_non_client_frame_view_aura.h

Issue 9359022: Aura: Support hovering restore & close buttons for full screen apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove resources, as they've already been committed Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
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_
7 #pragma once
8
9 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
10 #include "ui/base/animation/animation_delegate.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/mouse_watcher.h"
13
14 namespace aura {
15 class Window;
16 }
17
18 namespace ui {
19 class SlideAnimation;
20 }
21
22 // NonClientFrameViewAura implementation for apps.
23 class AppNonClientFrameViewAura : public BrowserNonClientFrameView,
24 public ui::AnimationDelegate,
25 public views::MouseWatcherListener {
26 public:
27 AppNonClientFrameViewAura(
28 BrowserFrame* frame, BrowserView* browser_view);
29 virtual ~AppNonClientFrameViewAura();
30
31 // NonClientFrameView:
32 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
33 virtual gfx::Rect GetWindowBoundsForClientBounds(
34 const gfx::Rect& client_bounds) const OVERRIDE;
35 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
36 virtual void GetWindowMask(
37 const gfx::Size& size,
38 gfx::Path* window_mask) OVERRIDE;
39 virtual void ResetWindowControls() OVERRIDE;
40 virtual void UpdateWindowIcon() OVERRIDE;
41
42 // BrowserNonClientFrameView:
43 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const
sky 2012/02/13 16:01:32 Similar to const, don't leave OVERRIDE on a line b
DaveMoore 2012/02/13 18:58:40 Done.
44 OVERRIDE;
45 virtual int GetHorizontalTabStripVerticalOffset(bool restored) const
46 OVERRIDE;
47 virtual void UpdateThrobber(bool running) OVERRIDE;
48
49 // View:
50 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
51
52 // ui::AnimationDelegate.
53 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
54
55 // views::MouseWatcherListener.
56 virtual void MouseMovedOutOfHost() OVERRIDE;
57
58 // Close the app window.
59 void Close();
60
61 // Restore the app window (will result in switching the frame_view back).
62 void Restore();
63
64 private:
65 class ControlView;
66 class Host;
67
68 gfx::Rect GetControlBounds() const;
69
70 // The View containing the restore and close buttons.
71 ControlView* control_view_;
72 // The widget holding the control_view_.
73 views::Widget* control_widget_;
74 // The animation that controls the display of the control_widget.
75 scoped_ptr<ui::SlideAnimation> show_animation_;
76 // Tracks the mouse and causes the controls to slide back up when it exits.
77 views::MouseWatcher mouse_watcher_;
78
79 DISALLOW_COPY_AND_ASSIGN(AppNonClientFrameViewAura);
80 };
81
82 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_APP_NON_CLIENT_FRAME_VIEW_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698