| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 views::View* content_view_; | 79 views::View* content_view_; |
| 80 | 80 |
| 81 DISALLOW_COPY_AND_ASSIGN(MaximizeBubbleBorder); | 81 DISALLOW_COPY_AND_ASSIGN(MaximizeBubbleBorder); |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 MaximizeBubbleBorder::MaximizeBubbleBorder(views::View* content_view, | 84 MaximizeBubbleBorder::MaximizeBubbleBorder(views::View* content_view, |
| 85 views::View* anchor) | 85 views::View* anchor) |
| 86 : views::BubbleBorder(views::BubbleBorder::TOP_RIGHT, | 86 : views::BubbleBorder(views::BubbleBorder::TOP_RIGHT, |
| 87 views::BubbleBorder::NO_SHADOW), | 87 views::BubbleBorder::NO_SHADOW), |
| 88 anchor_size_(anchor->size()), | 88 anchor_size_(anchor->size()), |
| 89 anchor_screen_origin_(0,0), | 89 anchor_screen_origin_(0, 0), |
| 90 content_view_(content_view) { | 90 content_view_(content_view) { |
| 91 views::View::ConvertPointToScreen(anchor, &anchor_screen_origin_); | 91 views::View::ConvertPointToScreen(anchor, &anchor_screen_origin_); |
| 92 set_alignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 92 set_alignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void MaximizeBubbleBorder::GetMask(gfx::Path* mask) { | 95 void MaximizeBubbleBorder::GetMask(gfx::Path* mask) { |
| 96 gfx::Insets inset; | 96 gfx::Insets inset; |
| 97 GetInsets(&inset); | 97 GetInsets(&inset); |
| 98 // Note: Even though the tip could be added as activatable, it is left out | 98 // Note: Even though the tip could be added as activatable, it is left out |
| 99 // since it would not change the action behavior in any way plus it makes | 99 // since it would not change the action behavior in any way plus it makes |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 set_margins(gfx::Insets()); | 392 set_margins(gfx::Insets()); |
| 393 | 393 |
| 394 // The window needs to be owned by the root so that the SnapSizer does not | 394 // The window needs to be owned by the root so that the SnapSizer does not |
| 395 // cover it upon animation. | 395 // cover it upon animation. |
| 396 aura::Window* parent = Shell::GetContainer( | 396 aura::Window* parent = Shell::GetContainer( |
| 397 Shell::GetActiveRootWindow(), | 397 Shell::GetActiveRootWindow(), |
| 398 internal::kShellWindowId_LauncherContainer); | 398 internal::kShellWindowId_LauncherContainer); |
| 399 set_parent_window(parent); | 399 set_parent_window(parent); |
| 400 | 400 |
| 401 set_notify_enter_exit_on_child(true); | 401 set_notify_enter_exit_on_child(true); |
| 402 set_try_mirroring_arrow(false); | 402 set_adjust_if_offscreen(false); |
| 403 SetPaintToLayer(true); | 403 SetPaintToLayer(true); |
| 404 SetFillsBoundsOpaquely(false); | 404 SetFillsBoundsOpaquely(false); |
| 405 set_color(kBubbleBackgroundColor); | 405 set_color(kBubbleBackgroundColor); |
| 406 set_close_on_deactivate(false); | 406 set_close_on_deactivate(false); |
| 407 set_background( | 407 set_background( |
| 408 views::Background::CreateSolidBackground(kBubbleBackgroundColor)); | 408 views::Background::CreateSolidBackground(kBubbleBackgroundColor)); |
| 409 | 409 |
| 410 SetLayoutManager(new views::BoxLayout( | 410 SetLayoutManager(new views::BoxLayout( |
| 411 views::BoxLayout::kVertical, 0, 0, kLayoutSpacing)); | 411 views::BoxLayout::kVertical, 0, 0, kLayoutSpacing)); |
| 412 | 412 |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 if (!GetBoundsInScreen().Contains(screen_location)) | 854 if (!GetBoundsInScreen().Contains(screen_location)) |
| 855 button_row_->ButtonHovered(NULL); | 855 button_row_->ButtonHovered(NULL); |
| 856 else | 856 else |
| 857 button_row_->ButtonHovered(this); | 857 button_row_->ButtonHovered(this); |
| 858 | 858 |
| 859 // Pass the event on to the normal handler. | 859 // Pass the event on to the normal handler. |
| 860 return views::ImageButton::OnMouseDragged(event); | 860 return views::ImageButton::OnMouseDragged(event); |
| 861 } | 861 } |
| 862 | 862 |
| 863 } // namespace ash | 863 } // namespace ash |
| OLD | NEW |