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_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
10 #include "ash/wm/workspace/frame_maximize_button.h" | 10 #include "ash/wm/workspace/frame_maximize_button.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 public: | 217 public: |
218 explicit Bubble(MaximizeBubbleController* owner, int appearance_delay_ms_); | 218 explicit Bubble(MaximizeBubbleController* owner, int appearance_delay_ms_); |
219 virtual ~Bubble() {} | 219 virtual ~Bubble() {} |
220 | 220 |
221 // The window of the menu under which the SnapSizer will get created. | 221 // The window of the menu under which the SnapSizer will get created. |
222 aura::Window* GetBubbleWindow(); | 222 aura::Window* GetBubbleWindow(); |
223 | 223 |
224 // Overridden from views::BubbleDelegateView. | 224 // Overridden from views::BubbleDelegateView. |
225 virtual gfx::Rect GetAnchorRect() OVERRIDE; | 225 virtual gfx::Rect GetAnchorRect() OVERRIDE; |
226 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 226 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
| 227 virtual bool CanActivate() const OVERRIDE { return false; } |
227 | 228 |
228 // Overridden from views::WidgetDelegateView. | 229 // Overridden from views::WidgetDelegateView. |
229 virtual bool HasHitTestMask() const OVERRIDE; | 230 virtual bool HasHitTestMask() const OVERRIDE; |
230 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; | 231 virtual void GetHitTestMask(gfx::Path* mask) const OVERRIDE; |
231 | 232 |
232 // Implementation of MouseWatcherListener. | 233 // Implementation of MouseWatcherListener. |
233 virtual void MouseMovedOutOfHost(); | 234 virtual void MouseMovedOutOfHost(); |
234 | 235 |
235 // Implementation of MouseWatcherHost. | 236 // Implementation of MouseWatcherHost. |
236 virtual bool Contains(const gfx::Point& screen_point, | 237 virtual bool Contains(const gfx::Point& screen_point, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 405 |
405 SetLayoutManager(new views::BoxLayout( | 406 SetLayoutManager(new views::BoxLayout( |
406 views::BoxLayout::kVertical, 0, 0, kLayoutSpacing)); | 407 views::BoxLayout::kVertical, 0, 0, kLayoutSpacing)); |
407 | 408 |
408 contents_view_ = new BubbleContentsView(this); | 409 contents_view_ = new BubbleContentsView(this); |
409 AddChildView(contents_view_); | 410 AddChildView(contents_view_); |
410 | 411 |
411 // Note that the returned widget has an observer which points to our | 412 // Note that the returned widget has an observer which points to our |
412 // functions. | 413 // functions. |
413 bubble_widget_ = views::BubbleDelegateView::CreateBubble(this); | 414 bubble_widget_ = views::BubbleDelegateView::CreateBubble(this); |
| 415 bubble_widget_->set_focus_on_creation(false); |
414 | 416 |
415 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 417 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
416 bubble_widget_->non_client_view()->frame_view()->set_background(NULL); | 418 bubble_widget_->non_client_view()->frame_view()->set_background(NULL); |
417 | 419 |
418 bubble_border_ = new MaximizeBubbleBorder(this, anchor_view()); | 420 bubble_border_ = new MaximizeBubbleBorder(this, anchor_view()); |
419 GetBubbleFrameView()->SetBubbleBorder(bubble_border_); | 421 GetBubbleFrameView()->SetBubbleBorder(bubble_border_); |
420 GetBubbleFrameView()->set_background(NULL); | 422 GetBubbleFrameView()->set_background(NULL); |
421 | 423 |
422 // Recalculate size with new border. | 424 // Recalculate size with new border. |
423 SizeToContents(); | 425 SizeToContents(); |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 if (!GetBoundsInScreen().Contains(screen_location)) | 809 if (!GetBoundsInScreen().Contains(screen_location)) |
808 button_row_->ButtonHovered(NULL); | 810 button_row_->ButtonHovered(NULL); |
809 else | 811 else |
810 button_row_->ButtonHovered(this); | 812 button_row_->ButtonHovered(this); |
811 | 813 |
812 // Pass the event on to the normal handler. | 814 // Pass the event on to the normal handler. |
813 return views::ImageButton::OnMouseDragged(event); | 815 return views::ImageButton::OnMouseDragged(event); |
814 } | 816 } |
815 | 817 |
816 } // namespace ash | 818 } // namespace ash |
OLD | NEW |