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 #include "ash/wm/maximize_bubble_controller.h" | 5 #include "ash/wm/maximize_bubble_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 virtual bool Contains(const gfx::Point& screen_point, | 197 virtual bool Contains(const gfx::Point& screen_point, |
198 views::MouseWatcherHost::MouseEventType type) OVERRIDE; | 198 views::MouseWatcherHost::MouseEventType type) OVERRIDE; |
199 private: | 199 private: |
200 MaximizeBubbleController::Bubble* bubble_; | 200 MaximizeBubbleController::Bubble* bubble_; |
201 | 201 |
202 DISALLOW_COPY_AND_ASSIGN(BubbleMouseWatcherHost); | 202 DISALLOW_COPY_AND_ASSIGN(BubbleMouseWatcherHost); |
203 }; | 203 }; |
204 | 204 |
205 // The class which creates and manages the bubble menu element. | 205 // The class which creates and manages the bubble menu element. |
206 // It creates a 'bubble border' and the content accordingly. | 206 // It creates a 'bubble border' and the content accordingly. |
207 // Note: Since the SnapSizer will show animations on top of the maximize button | 207 // Note: Since the PhantomWindowController will show animations on top of the |
208 // this menu gets created as a separate window and the SnapSizer will be | 208 // maximize button this menu gets created as a separate window and the phantom |
209 // created underneath this window. | 209 // window will be created underneath this window. |
210 class MaximizeBubbleController::Bubble : public views::BubbleDelegateView, | 210 class MaximizeBubbleController::Bubble : public views::BubbleDelegateView, |
211 public views::MouseWatcherListener { | 211 public views::MouseWatcherListener { |
212 public: | 212 public: |
213 explicit Bubble(MaximizeBubbleController* owner, int appearance_delay_ms_); | 213 explicit Bubble(MaximizeBubbleController* owner, int appearance_delay_ms_); |
214 virtual ~Bubble() {} | 214 virtual ~Bubble() {} |
215 | 215 |
216 // The window of the menu under which the SnapSizer will get created. | 216 // The window of the menu under which the phantom window will get created. |
217 aura::Window* GetBubbleWindow(); | 217 aura::Window* GetBubbleWindow(); |
218 | 218 |
219 // Overridden from views::BubbleDelegateView. | 219 // Overridden from views::BubbleDelegateView. |
220 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 220 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
221 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 221 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
222 virtual bool CanActivate() const OVERRIDE { return false; } | 222 virtual bool CanActivate() const OVERRIDE { return false; } |
223 | 223 |
224 // Overridden from views::WidgetDelegateView. | 224 // Overridden from views::WidgetDelegateView. |
225 virtual bool WidgetHasHitTestMask() const OVERRIDE; | 225 virtual bool WidgetHasHitTestMask() const OVERRIDE; |
226 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; | 226 virtual void GetWidgetHitTestMask(gfx::Path* mask) const OVERRIDE; |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
855 if (!GetBoundsInScreen().Contains(screen_location)) | 855 if (!GetBoundsInScreen().Contains(screen_location)) |
856 button_row_->ButtonHovered(NULL); | 856 button_row_->ButtonHovered(NULL); |
857 else | 857 else |
858 button_row_->ButtonHovered(this); | 858 button_row_->ButtonHovered(this); |
859 | 859 |
860 // Pass the event on to the normal handler. | 860 // Pass the event on to the normal handler. |
861 return views::ImageButton::OnMouseDragged(event); | 861 return views::ImageButton::OnMouseDragged(event); |
862 } | 862 } |
863 | 863 |
864 } // namespace ash | 864 } // namespace ash |
OLD | NEW |