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

Side by Side Diff: ash/wm/drag_window_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
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/drag_window_controller.h" 5 #include "ash/wm/drag_window_controller.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "ash/wm/window_util.h" 8 #include "ash/wm/window_util.h"
9 #include "ui/aura/client/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator()); 59 ui::ScopedLayerAnimationSettings scoped_setter(layer->GetAnimator());
60 layer->SetOpacity(opacity); 60 layer->SetOpacity(opacity);
61 } 61 }
62 62
63 void DragWindowController::CreateDragWidget(const gfx::Rect& bounds) { 63 void DragWindowController::CreateDragWidget(const gfx::Rect& bounds) {
64 DCHECK(!drag_widget_); 64 DCHECK(!drag_widget_);
65 drag_widget_ = new views::Widget; 65 drag_widget_ = new views::Widget;
66 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 66 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
67 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 67 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
68 params.parent = window_->parent(); 68 params.parent = window_->parent();
69 params.can_activate = false;
70 params.keep_on_top = true; 69 params.keep_on_top = true;
71 drag_widget_->set_focus_on_creation(false); 70 drag_widget_->set_focus_on_creation(false);
72 drag_widget_->Init(params); 71 drag_widget_->Init(params);
73 drag_widget_->SetVisibilityChangedAnimationsEnabled(false); 72 drag_widget_->SetVisibilityChangedAnimationsEnabled(false);
74 drag_widget_->GetNativeWindow()->SetName("DragWindow"); 73 drag_widget_->GetNativeWindow()->SetName("DragWindow");
75 drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); 74 drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow);
76 // Show shadow for the dragging window. 75 // Show shadow for the dragging window.
77 SetShadowType(drag_widget_->GetNativeWindow(), 76 SetShadowType(drag_widget_->GetNativeWindow(),
78 ::wm::SHADOW_TYPE_RECTANGULAR); 77 ::wm::SHADOW_TYPE_RECTANGULAR);
79 SetBoundsInternal(bounds); 78 SetBoundsInternal(bounds);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 // Place the layer at (0, 0) of the DragWindowController's window. 111 // Place the layer at (0, 0) of the DragWindowController's window.
113 gfx::Rect layer_bounds = layer_owner_->root()->bounds(); 112 gfx::Rect layer_bounds = layer_owner_->root()->bounds();
114 layer_bounds.set_origin(gfx::Point(0, 0)); 113 layer_bounds.set_origin(gfx::Point(0, 0));
115 layer_owner_->root()->SetBounds(layer_bounds); 114 layer_owner_->root()->SetBounds(layer_bounds);
116 layer_owner_->root()->SetVisible(false); 115 layer_owner_->root()->SetVisible(false);
117 // Detach it from the current container. 116 // Detach it from the current container.
118 layer_owner_->root()->parent()->Remove(layer_owner_->root()); 117 layer_owner_->root()->parent()->Remove(layer_owner_->root());
119 } 118 }
120 119
121 } // namespace ash 120 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.cc ('k') | ash/wm/gestures/long_press_affordance_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698