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

Side by Side Diff: ash/wm/workspace/frame_maximize_button.h

Issue 10825327: Adding unit tests for maximize menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing build stopper Created 8 years, 4 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
« no previous file with comments | « ash/wm/maximize_bubble_controller.cc ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ 5 #ifndef ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_
6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ 6 #define ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/workspace/snap_types.h" 9 #include "ash/wm/workspace/snap_types.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // ImageButton overrides: 56 // ImageButton overrides:
57 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; 57 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
58 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; 58 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE;
59 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; 59 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE;
60 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; 60 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE;
61 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; 61 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
62 virtual void OnMouseCaptureLost() OVERRIDE; 62 virtual void OnMouseCaptureLost() OVERRIDE;
63 virtual ui::GestureStatus OnGestureEvent( 63 virtual ui::GestureStatus OnGestureEvent(
64 const views::GestureEvent& event) OVERRIDE; 64 const views::GestureEvent& event) OVERRIDE;
65 65
66 // Unit test overwrite: Change the UI delay used for the bubble show up.
67 void set_bubble_appearance_delay_ms(int bubble_appearance_delay_ms) {
68 bubble_appearance_delay_ms_ = bubble_appearance_delay_ms;
69 }
70
71 // Unit test accessor for the maximize bubble.
72 MaximizeBubbleController* maximizer() { return maximizer_.get(); }
73
74 // Unit test to see if phantom window is open.
75 bool phantom_window_open() { return phantom_window_.get() != NULL; }
76
66 private: 77 private:
67 class EscapeEventFilter; 78 class EscapeEventFilter;
68 79
69 // Initializes the snap-gesture based on the event. This should only be called 80 // Initializes the snap-gesture based on the event. This should only be called
70 // when the event is confirmed to have started a snap gesture. 81 // when the event is confirmed to have started a snap gesture.
71 void ProcessStartEvent(const ui::LocatedEvent& event); 82 void ProcessStartEvent(const ui::LocatedEvent& event);
72 83
73 // Updates the snap-state based on the current event. This should only be 84 // Updates the snap-state based on the current event. This should only be
74 // called after the snap gesture has already started. 85 // called after the snap gesture has already started.
75 void ProcessUpdateEvent(const ui::LocatedEvent& event); 86 void ProcessUpdateEvent(const ui::LocatedEvent& event);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 SnapType snap_type_; 140 SnapType snap_type_;
130 141
131 scoped_ptr<internal::SnapSizer> snap_sizer_; 142 scoped_ptr<internal::SnapSizer> snap_sizer_;
132 143
133 scoped_ptr<EscapeEventFilter> escape_event_filter_; 144 scoped_ptr<EscapeEventFilter> escape_event_filter_;
134 145
135 base::OneShotTimer<FrameMaximizeButton> update_timer_; 146 base::OneShotTimer<FrameMaximizeButton> update_timer_;
136 147
137 scoped_ptr<MaximizeBubbleController> maximizer_; 148 scoped_ptr<MaximizeBubbleController> maximizer_;
138 149
150 // The delay of the bubble appearance.
151 int bubble_appearance_delay_ms_;
152
139 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton); 153 DISALLOW_COPY_AND_ASSIGN(FrameMaximizeButton);
140 }; 154 };
141 155
142 } // namespace ash 156 } // namespace ash
143 157
144 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_ 158 #endif // ASH_WM_WORKSPACE_FRAME_MAXIMIZE_BUTTON_H_
OLDNEW
« no previous file with comments | « ash/wm/maximize_bubble_controller.cc ('k') | ash/wm/workspace/frame_maximize_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698