| 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/common/workspace/multi_window_resize_controller.h" | 5 #include "ash/wm/common/workspace/multi_window_resize_controller.h" |
| 6 | 6 |
| 7 #include "ash/wm/common/wm_lookup.h" |
| 7 #include "ash/wm/common/wm_root_window_controller.h" | 8 #include "ash/wm/common/wm_root_window_controller.h" |
| 8 #include "ash/wm/common/wm_shell_window_ids.h" | 9 #include "ash/wm/common/wm_shell_window_ids.h" |
| 9 #include "ash/wm/common/wm_window.h" | 10 #include "ash/wm/common/wm_window.h" |
| 10 #include "ash/wm/common/workspace/workspace_window_resizer.h" | 11 #include "ash/wm/common/workspace/workspace_window_resizer.h" |
| 11 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
| 12 #include "ui/base/cursor/cursor.h" | 13 #include "ui/base/cursor/cursor.h" |
| 13 #include "ui/base/hit_test.h" | 14 #include "ui/base/hit_test.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
| 15 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 16 #include "ui/gfx/canvas.h" | 17 #include "ui/gfx/canvas.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 377 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 377 params.name = "MultiWindowResizeController"; | 378 params.name = "MultiWindowResizeController"; |
| 378 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 379 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 379 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 380 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 380 windows_.window1->GetRootWindowController() | 381 windows_.window1->GetRootWindowController() |
| 381 ->ConfigureWidgetInitParamsForContainer( | 382 ->ConfigureWidgetInitParamsForContainer( |
| 382 resize_widget_.get(), kShellWindowId_AlwaysOnTopContainer, ¶ms); | 383 resize_widget_.get(), kShellWindowId_AlwaysOnTopContainer, ¶ms); |
| 383 ResizeView* view = new ResizeView(this, windows_.direction); | 384 ResizeView* view = new ResizeView(this, windows_.direction); |
| 384 resize_widget_->set_focus_on_creation(false); | 385 resize_widget_->set_focus_on_creation(false); |
| 385 resize_widget_->Init(params); | 386 resize_widget_->Init(params); |
| 386 wm::WmWindow::Get(resize_widget_.get()) | 387 wm::WmLookup::Get() |
| 388 ->GetWindowForWidget(resize_widget_.get()) |
| 387 ->SetVisibilityAnimationType(::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 389 ->SetVisibilityAnimationType(::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); |
| 388 resize_widget_->SetContentsView(view); | 390 resize_widget_->SetContentsView(view); |
| 389 show_bounds_in_screen_ = windows_.window1->GetParent()->ConvertRectToScreen( | 391 show_bounds_in_screen_ = windows_.window1->GetParent()->ConvertRectToScreen( |
| 390 CalculateResizeWidgetBounds(show_location_in_parent_)); | 392 CalculateResizeWidgetBounds(show_location_in_parent_)); |
| 391 resize_widget_->SetBounds(show_bounds_in_screen_); | 393 resize_widget_->SetBounds(show_bounds_in_screen_); |
| 392 resize_widget_->Show(); | 394 resize_widget_->Show(); |
| 393 CreateMouseWatcher(); | 395 CreateMouseWatcher(); |
| 394 } | 396 } |
| 395 | 397 |
| 396 bool MultiWindowResizeController::IsShowing() const { | 398 bool MultiWindowResizeController::IsShowing() const { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 533 |
| 532 bool MultiWindowResizeController::IsOverComponent( | 534 bool MultiWindowResizeController::IsOverComponent( |
| 533 wm::WmWindow* window, | 535 wm::WmWindow* window, |
| 534 const gfx::Point& location_in_screen, | 536 const gfx::Point& location_in_screen, |
| 535 int component) const { | 537 int component) const { |
| 536 gfx::Point window_loc = window->ConvertPointFromScreen(location_in_screen); | 538 gfx::Point window_loc = window->ConvertPointFromScreen(location_in_screen); |
| 537 return window->GetNonClientComponent(window_loc) == component; | 539 return window->GetNonClientComponent(window_loc) == component; |
| 538 } | 540 } |
| 539 | 541 |
| 540 } // namespace ash | 542 } // namespace ash |
| OLD | NEW |