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

Side by Side Diff: ash/wm/caption_buttons/alternate_frame_size_button.h

Issue 101773004: Refactor PhantomWindowController so that the PhantomWindowController owns the phantom window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ 5 #ifndef ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_
6 #define ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ 6 #define ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/caption_buttons/alternate_frame_size_button_delegate.h" 9 #include "ash/wm/caption_buttons/alternate_frame_size_button_delegate.h"
10 #include "ash/wm/caption_buttons/frame_caption_button.h" 10 #include "ash/wm/caption_buttons/frame_caption_button.h"
11 #include "ash/wm/workspace/snap_types.h" 11 #include "ash/wm/workspace/snap_types.h"
12 #include "base/timer/timer.h" 12 #include "base/timer/timer.h"
13 13
14 namespace views { 14 namespace views {
15 class Widget; 15 class Widget;
16 } 16 }
17 17
18 namespace ash { 18 namespace ash {
19 class AlternateFrameSizeButtonDelegate; 19 class AlternateFrameSizeButtonDelegate;
20 20
21 namespace internal {
22 class PhantomWindowController;
23 }
24
21 // The maximize/restore button when using the alternate button style. 25 // The maximize/restore button when using the alternate button style.
22 // When the mouse is pressed over the size button or the size button is touched: 26 // When the mouse is pressed over the size button or the size button is touched:
23 // - The minimize and close buttons are set to snap left and snap right 27 // - The minimize and close buttons are set to snap left and snap right
24 // respectively. 28 // respectively.
25 // - The pressed button is updated during the drag to reflect the button 29 // - The pressed button is updated during the drag to reflect the button
26 // underneath the mouse cursor. (The size button is potentially unpressed). 30 // underneath the mouse cursor. (The size button is potentially unpressed).
27 // When the drag terminates, the action for the pressed button is executed. 31 // When the drag terminates, the action for the pressed button is executed.
28 // For the sake of simplicity, the size button is the event handler for a click 32 // For the sake of simplicity, the size button is the event handler for a click
29 // starting on the size button and the entire drag (including when the size 33 // starting on the size button and the entire drag (including when the size
30 // button is unpressed). 34 // button is unpressed).
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 base::OneShotTimer<AlternateFrameSizeButton> set_buttons_to_snap_mode_timer_; 89 base::OneShotTimer<AlternateFrameSizeButton> set_buttons_to_snap_mode_timer_;
86 90
87 // Whether the buttons adjacent to the size button snap the window left and 91 // Whether the buttons adjacent to the size button snap the window left and
88 // right. 92 // right.
89 bool in_snap_mode_; 93 bool in_snap_mode_;
90 94
91 // The action of the currently pressed button. If |snap_type_| == SNAP_NONE, 95 // The action of the currently pressed button. If |snap_type_| == SNAP_NONE,
92 // the size button's default action is run when clicked. 96 // the size button's default action is run when clicked.
93 SnapType snap_type_; 97 SnapType snap_type_;
94 98
99 // Displays a preview of how the window's bounds will change as a result of
100 // snapping the window left or right. The preview is only visible if the snap
101 // left or snap right button is pressed.
102 scoped_ptr<internal::PhantomWindowController> phantom_window_controller_;
103
95 DISALLOW_COPY_AND_ASSIGN(AlternateFrameSizeButton); 104 DISALLOW_COPY_AND_ASSIGN(AlternateFrameSizeButton);
96 }; 105 };
97 106
98 } // namespace ash 107 } // namespace ash
99 108
100 #endif // ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_ 109 #endif // ASH_WM_CAPTION_BUTTONS_ALTERNATE_FRAME_SIZE_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698