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

Side by Side Diff: ash/wm/workspace/phantom_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/workspace/phantom_window_controller.h" 5 #include "ash/wm/workspace/phantom_window_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 aura::Window* root_window, 107 aura::Window* root_window,
108 const gfx::Rect& bounds_in_screen) { 108 const gfx::Rect& bounds_in_screen) {
109 scoped_ptr<views::Widget> phantom_widget(new views::Widget); 109 scoped_ptr<views::Widget> phantom_widget(new views::Widget);
110 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 110 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
111 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 111 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
112 // PhantomWindowController is used by FrameMaximizeButton to highlight the 112 // PhantomWindowController is used by FrameMaximizeButton to highlight the
113 // launcher button. Put the phantom in the same window as the launcher so that 113 // launcher button. Put the phantom in the same window as the launcher so that
114 // the phantom is visible. 114 // the phantom is visible.
115 params.parent = Shell::GetContainer(root_window, 115 params.parent = Shell::GetContainer(root_window,
116 kShellWindowId_ShelfContainer); 116 kShellWindowId_ShelfContainer);
117 params.can_activate = false;
118 params.keep_on_top = true; 117 params.keep_on_top = true;
119 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 118 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
120 phantom_widget->set_focus_on_creation(false); 119 phantom_widget->set_focus_on_creation(false);
121 phantom_widget->Init(params); 120 phantom_widget->Init(params);
122 phantom_widget->SetVisibilityChangedAnimationsEnabled(false); 121 phantom_widget->SetVisibilityChangedAnimationsEnabled(false);
123 phantom_widget->GetNativeWindow()->SetName("PhantomWindow"); 122 phantom_widget->GetNativeWindow()->SetName("PhantomWindow");
124 phantom_widget->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow); 123 phantom_widget->GetNativeWindow()->set_id(kShellWindowId_PhantomWindow);
125 phantom_widget->SetBounds(bounds_in_screen); 124 phantom_widget->SetBounds(bounds_in_screen);
126 phantom_widget->StackAbove(window_); 125 phantom_widget->StackAbove(window_);
127 126
(...skipping 13 matching lines...) Expand all
141 widget_layer->SetOpacity(0); 140 widget_layer->SetOpacity(0);
142 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); 141 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator());
143 scoped_setter.SetTransitionDuration( 142 scoped_setter.SetTransitionDuration(
144 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); 143 base::TimeDelta::FromMilliseconds(kAnimationDurationMs));
145 widget_layer->SetOpacity(1); 144 widget_layer->SetOpacity(1);
146 145
147 return phantom_widget.Pass(); 146 return phantom_widget.Pass();
148 } 147 }
149 148
150 } // namespace ash 149 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/multi_window_resize_controller.cc ('k') | chrome/browser/chromeos/ui/idle_app_name_notification_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698