| OLD | NEW |
| 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 #include "ash/wm/caption_buttons/maximize_bubble_controller.h" | 5 #include "ash/wm/caption_buttons/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/caption_buttons/frame_maximize_button.h" | 10 #include "ash/wm/caption_buttons/frame_maximize_button.h" |
| (...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 // Tell the parent to destroy us (if this didn't happen yet). | 811 // Tell the parent to destroy us (if this didn't happen yet). |
| 812 if (timer_) { | 812 if (timer_) { |
| 813 timer_.reset(NULL); | 813 timer_.reset(NULL); |
| 814 // Informs the owner that the menu is gone and requests |this| destruction. | 814 // Informs the owner that the menu is gone and requests |this| destruction. |
| 815 frame_maximize_button_->DestroyMaximizeMenu(); | 815 frame_maximize_button_->DestroyMaximizeMenu(); |
| 816 // Note: After this call |this| is destroyed. | 816 // Note: After this call |this| is destroyed. |
| 817 } | 817 } |
| 818 } | 818 } |
| 819 | 819 |
| 820 void MaximizeBubbleController::CreateBubble() { | 820 void MaximizeBubbleController::CreateBubble() { |
| 821 if (!bubble_) | 821 if (!bubble_) { |
| 822 bubble_ = new Bubble(this, appearance_delay_ms_, snap_type_for_creation_); | 822 bubble_ = new Bubble(this, appearance_delay_ms_, snap_type_for_creation_); |
| 823 frame_maximize_button_->OnMaximizeBubbleShown(bubble_->GetWidget()); |
| 824 } |
| 823 | 825 |
| 824 timer_->Stop(); | 826 timer_->Stop(); |
| 825 } | 827 } |
| 826 | 828 |
| 827 BubbleDialogButton::BubbleDialogButton( | 829 BubbleDialogButton::BubbleDialogButton( |
| 828 BubbleContentsButtonRow* button_row, | 830 BubbleContentsButtonRow* button_row, |
| 829 int normal_image, | 831 int normal_image, |
| 830 int hovered_image, | 832 int hovered_image, |
| 831 int pressed_image) | 833 int pressed_image) |
| 832 : views::ImageButton(button_row), | 834 : views::ImageButton(button_row), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 if (!GetBoundsInScreen().Contains(screen_location)) | 868 if (!GetBoundsInScreen().Contains(screen_location)) |
| 867 button_row_->ButtonHovered(NULL); | 869 button_row_->ButtonHovered(NULL); |
| 868 else | 870 else |
| 869 button_row_->ButtonHovered(this); | 871 button_row_->ButtonHovered(this); |
| 870 | 872 |
| 871 // Pass the event on to the normal handler. | 873 // Pass the event on to the normal handler. |
| 872 return views::ImageButton::OnMouseDragged(event); | 874 return views::ImageButton::OnMouseDragged(event); |
| 873 } | 875 } |
| 874 | 876 |
| 875 } // namespace ash | 877 } // namespace ash |
| OLD | NEW |