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

Side by Side Diff: ash/wm/overview/scoped_window_copy.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/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/wm/overview/window_overview.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/overview/scoped_window_copy.h" 5 #include "ash/wm/overview/scoped_window_copy.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 "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/screen_position_client.h" 10 #include "ui/aura/client/screen_position_client.h"
(...skipping 17 matching lines...) Expand all
28 // Save and remove the transform from the layer to later reapply to both the 28 // Save and remove the transform from the layer to later reapply to both the
29 // source and newly created copy window. 29 // source and newly created copy window.
30 gfx::Transform transform = recreated_layer->transform(); 30 gfx::Transform transform = recreated_layer->transform();
31 recreated_layer->SetTransform(gfx::Transform()); 31 recreated_layer->SetTransform(gfx::Transform());
32 32
33 src_window->SetTransform(transform); 33 src_window->SetTransform(transform);
34 views::Widget* widget = new views::Widget; 34 views::Widget* widget = new views::Widget;
35 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 35 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
36 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 36 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
37 params.parent = src_window->parent(); 37 params.parent = src_window->parent();
38 params.can_activate = false;
39 params.keep_on_top = true; 38 params.keep_on_top = true;
40 widget->set_focus_on_creation(false); 39 widget->set_focus_on_creation(false);
41 widget->Init(params); 40 widget->Init(params);
42 widget->SetVisibilityChangedAnimationsEnabled(false); 41 widget->SetVisibilityChangedAnimationsEnabled(false);
43 std::string name = src_window->name() + " (Copy)"; 42 std::string name = src_window->name() + " (Copy)";
44 widget->GetNativeWindow()->SetName(name); 43 widget->GetNativeWindow()->SetName(name);
45 ::wm::SetShadowType(widget->GetNativeWindow(), 44 ::wm::SetShadowType(widget->GetNativeWindow(),
46 ::wm::SHADOW_TYPE_RECTANGULAR); 45 ::wm::SHADOW_TYPE_RECTANGULAR);
47 46
48 // Set the bounds in the target root window. 47 // Set the bounds in the target root window.
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // The cleanup observer will delete itself and the window when any pending 169 // The cleanup observer will delete itself and the window when any pending
171 // animations have completed. 170 // animations have completed.
172 cleanup_observer_->TakeOwnershipOfWidget(); 171 cleanup_observer_->TakeOwnershipOfWidget();
173 } 172 }
174 173
175 aura::Window* ScopedWindowCopy::GetWindow() { 174 aura::Window* ScopedWindowCopy::GetWindow() {
176 return widget_->GetNativeWindow(); 175 return widget_->GetNativeWindow();
177 } 176 }
178 177
179 } // namespace ash 178 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/maximize_mode/workspace_backdrop_delegate.cc ('k') | ash/wm/overview/window_overview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698