Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Side by Side Diff: ash/wm/workspace/multi_window_resize_controller.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/workspace/phantom_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/workspace/multi_window_resize_controller.h" 5 #include "ash/wm/workspace/multi_window_resize_controller.h"
6 6
7 #include "ash/screen_util.h" 7 #include "ash/screen_util.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 void MultiWindowResizeController::ShowNow() { 379 void MultiWindowResizeController::ShowNow() {
380 DCHECK(!resize_widget_.get()); 380 DCHECK(!resize_widget_.get());
381 DCHECK(windows_.is_valid()); 381 DCHECK(windows_.is_valid());
382 show_timer_.Stop(); 382 show_timer_.Stop();
383 resize_widget_.reset(new views::Widget); 383 resize_widget_.reset(new views::Widget);
384 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 384 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
385 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 385 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
386 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 386 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
387 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(), 387 params.parent = Shell::GetContainer(Shell::GetTargetRootWindow(),
388 kShellWindowId_AlwaysOnTopContainer); 388 kShellWindowId_AlwaysOnTopContainer);
389 params.can_activate = false;
390 ResizeView* view = new ResizeView(this, windows_.direction); 389 ResizeView* view = new ResizeView(this, windows_.direction);
391 resize_widget_->set_focus_on_creation(false); 390 resize_widget_->set_focus_on_creation(false);
392 resize_widget_->Init(params); 391 resize_widget_->Init(params);
393 ::wm::SetWindowVisibilityAnimationType( 392 ::wm::SetWindowVisibilityAnimationType(
394 resize_widget_->GetNativeWindow(), 393 resize_widget_->GetNativeWindow(),
395 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); 394 ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
396 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController"); 395 resize_widget_->GetNativeWindow()->SetName("MultiWindowResizeController");
397 resize_widget_->SetContentsView(view); 396 resize_widget_->SetContentsView(view);
398 show_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen( 397 show_bounds_in_screen_ = ScreenUtil::ConvertRectToScreen(
399 windows_.window1->parent(), 398 windows_.window1->parent(),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 return false; 533 return false;
535 534
536 gfx::Point window_loc(location_in_screen); 535 gfx::Point window_loc(location_in_screen);
537 aura::Window::ConvertPointToTarget( 536 aura::Window::ConvertPointToTarget(
538 window->GetRootWindow(), window, &window_loc); 537 window->GetRootWindow(), window, &window_loc);
539 return window->ContainsPoint(window_loc) && 538 return window->ContainsPoint(window_loc) &&
540 window->delegate()->GetNonClientComponent(window_loc) == component; 539 window->delegate()->GetNonClientComponent(window_loc) == component;
541 } 540 }
542 541
543 } // namespace ash 542 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/workspace/phantom_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698