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

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; 69 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
sky 2014/05/14 14:06:30 How come you're explicit here, but in places like
pkotwicz 2014/05/14 15:24:38 There is no reason to be explicit here (or anywher
70 params.keep_on_top = true; 70 params.keep_on_top = true;
71 drag_widget_->set_focus_on_creation(false); 71 drag_widget_->set_focus_on_creation(false);
72 drag_widget_->Init(params); 72 drag_widget_->Init(params);
73 drag_widget_->SetVisibilityChangedAnimationsEnabled(false); 73 drag_widget_->SetVisibilityChangedAnimationsEnabled(false);
74 drag_widget_->GetNativeWindow()->SetName("DragWindow"); 74 drag_widget_->GetNativeWindow()->SetName("DragWindow");
75 drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); 75 drag_widget_->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow);
76 // Show shadow for the dragging window. 76 // Show shadow for the dragging window.
77 SetShadowType(drag_widget_->GetNativeWindow(), 77 SetShadowType(drag_widget_->GetNativeWindow(),
78 ::wm::SHADOW_TYPE_RECTANGULAR); 78 ::wm::SHADOW_TYPE_RECTANGULAR);
79 SetBoundsInternal(bounds); 79 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. 112 // Place the layer at (0, 0) of the DragWindowController's window.
113 gfx::Rect layer_bounds = layer_owner_->root()->bounds(); 113 gfx::Rect layer_bounds = layer_owner_->root()->bounds();
114 layer_bounds.set_origin(gfx::Point(0, 0)); 114 layer_bounds.set_origin(gfx::Point(0, 0));
115 layer_owner_->root()->SetBounds(layer_bounds); 115 layer_owner_->root()->SetBounds(layer_bounds);
116 layer_owner_->root()->SetVisible(false); 116 layer_owner_->root()->SetVisible(false);
117 // Detach it from the current container. 117 // Detach it from the current container.
118 layer_owner_->root()->parent()->Remove(layer_owner_->root()); 118 layer_owner_->root()->parent()->Remove(layer_owner_->root());
119 } 119 }
120 120
121 } // namespace ash 121 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698