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

Side by Side Diff: ash/wm/common/workspace/phantom_window_controller.cc

Issue 1950573002: Nukes WmWindow::SetName() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ash/wm/common/wm_window.h ('k') | no next file » | 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/common/workspace/phantom_window_controller.h" 5 #include "ash/wm/common/workspace/phantom_window_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "ash/wm/common/root_window_finder.h" 9 #include "ash/wm/common/root_window_finder.h"
10 #include "ash/wm/common/wm_root_window_controller.h" 10 #include "ash/wm/common/wm_root_window_controller.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 wm::WmWindow* root_window, 105 wm::WmWindow* root_window,
106 const gfx::Rect& bounds_in_screen) { 106 const gfx::Rect& bounds_in_screen) {
107 std::unique_ptr<views::Widget> phantom_widget(new views::Widget); 107 std::unique_ptr<views::Widget> phantom_widget(new views::Widget);
108 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 108 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
109 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 109 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
110 // PhantomWindowController is used by FrameMaximizeButton to highlight the 110 // PhantomWindowController is used by FrameMaximizeButton to highlight the
111 // launcher button. Put the phantom in the same window as the launcher so that 111 // launcher button. Put the phantom in the same window as the launcher so that
112 // the phantom is visible. 112 // the phantom is visible.
113 params.keep_on_top = true; 113 params.keep_on_top = true;
114 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 114 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
115 params.name = "PhantomWindow";
115 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 116 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
116 phantom_widget.get(), kShellWindowId_ShelfContainer, &params); 117 phantom_widget.get(), kShellWindowId_ShelfContainer, &params);
117 phantom_widget->set_focus_on_creation(false); 118 phantom_widget->set_focus_on_creation(false);
118 phantom_widget->Init(params); 119 phantom_widget->Init(params);
119 phantom_widget->SetVisibilityChangedAnimationsEnabled(false); 120 phantom_widget->SetVisibilityChangedAnimationsEnabled(false);
120 wm::WmWindow* phantom_widget_window = wm::WmWindow::Get(phantom_widget.get()); 121 wm::WmWindow* phantom_widget_window = wm::WmWindow::Get(phantom_widget.get());
121 phantom_widget_window->SetName("PhantomWindow");
122 phantom_widget_window->SetShellWindowId(kShellWindowId_PhantomWindow); 122 phantom_widget_window->SetShellWindowId(kShellWindowId_PhantomWindow);
123 phantom_widget->SetBounds(bounds_in_screen); 123 phantom_widget->SetBounds(bounds_in_screen);
124 // TODO(sky): I suspect this is never true, verify that. 124 // TODO(sky): I suspect this is never true, verify that.
125 if (phantom_widget_window->GetParent() == window_->GetParent()) { 125 if (phantom_widget_window->GetParent() == window_->GetParent()) {
126 phantom_widget_window->GetParent()->StackChildAbove(phantom_widget_window, 126 phantom_widget_window->GetParent()->StackChildAbove(phantom_widget_window,
127 window_); 127 window_);
128 } 128 }
129 129
130 const int kImages[] = IMAGE_GRID(IDR_AURA_PHANTOM_WINDOW); 130 const int kImages[] = IMAGE_GRID(IDR_AURA_PHANTOM_WINDOW);
131 views::Painter* background_painter = 131 views::Painter* background_painter =
(...skipping 11 matching lines...) Expand all
143 widget_layer->SetOpacity(0); 143 widget_layer->SetOpacity(0);
144 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator()); 144 ui::ScopedLayerAnimationSettings scoped_setter(widget_layer->GetAnimator());
145 scoped_setter.SetTransitionDuration( 145 scoped_setter.SetTransitionDuration(
146 base::TimeDelta::FromMilliseconds(kAnimationDurationMs)); 146 base::TimeDelta::FromMilliseconds(kAnimationDurationMs));
147 widget_layer->SetOpacity(1); 147 widget_layer->SetOpacity(1);
148 148
149 return phantom_widget; 149 return phantom_widget;
150 } 150 }
151 151
152 } // namespace ash 152 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/common/wm_window.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698