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

Side by Side Diff: ui/views/mus/desktop_window_tree_host_mus.cc

Issue 2480713003: Window prerequisites for ShelfWindowWatcher panel support. (Closed)
Patch Set: Fix ShellSurface KAppIdKey use; remove local application_id_. Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/mus/desktop_window_tree_host_mus.h" 5 #include "ui/views/mus/desktop_window_tree_host_mus.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/drag_drop_client.h" 9 #include "ui/aura/client/drag_drop_client.h"
10 #include "ui/aura/client/focus_client.h" 10 #include "ui/aura/client/focus_client.h"
11 #include "ui/aura/mus/window_tree_host_mus.h" 11 #include "ui/aura/mus/window_tree_host_mus.h"
12 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
13 #include "ui/display/screen.h" 13 #include "ui/display/screen.h"
14 #include "ui/views/corewm/tooltip_aura.h" 14 #include "ui/views/corewm/tooltip_aura.h"
15 #include "ui/views/mus/mus_client.h" 15 #include "ui/views/mus/mus_client.h"
16 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" 16 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
17 #include "ui/views/widget/native_widget_aura.h"
17 #include "ui/views/widget/widget_delegate.h" 18 #include "ui/views/widget/widget_delegate.h"
18 #include "ui/wm/core/window_util.h" 19 #include "ui/wm/core/window_util.h"
19 #include "ui/wm/public/activation_client.h" 20 #include "ui/wm/public/activation_client.h"
20 21
21 namespace views { 22 namespace views {
22 23
23 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus( 24 DesktopWindowTreeHostMus::DesktopWindowTreeHostMus(
24 internal::NativeWidgetDelegate* native_widget_delegate, 25 internal::NativeWidgetDelegate* native_widget_delegate,
25 DesktopNativeWidgetAura* desktop_native_widget_aura) 26 DesktopNativeWidgetAura* desktop_native_widget_aura)
26 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()), 27 : aura::WindowTreeHostMus(MusClient::Get()->window_tree_client()),
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 ui::SHOW_STATE_FULLSCREEN; 298 ui::SHOW_STATE_FULLSCREEN;
298 } 299 }
299 void DesktopWindowTreeHostMus::SetOpacity(float opacity) { 300 void DesktopWindowTreeHostMus::SetOpacity(float opacity) {
300 // TODO: this likely need to go to server so that non-client decorations get 301 // TODO: this likely need to go to server so that non-client decorations get
301 // opacity. 302 // opacity.
302 window()->layer()->SetOpacity(opacity); 303 window()->layer()->SetOpacity(opacity);
303 } 304 }
304 305
305 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon, 306 void DesktopWindowTreeHostMus::SetWindowIcons(const gfx::ImageSkia& window_icon,
306 const gfx::ImageSkia& app_icon) { 307 const gfx::ImageSkia& app_icon) {
307 if (window_icon.isNull() && app_icon.isNull()) { 308 NativeWidgetAura::AssignIconToAuraWindow(window(), window_icon, app_icon);
308 window()->ClearProperty(aura::client::kWindowIconKey);
309 return;
310 }
311
312 window()->SetProperty(
313 aura::client::kWindowIconKey,
314 new gfx::ImageSkia(!window_icon.isNull() ? window_icon : app_icon));
315 } 309 }
316 310
317 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) { 311 void DesktopWindowTreeHostMus::InitModalType(ui::ModalType modal_type) {
318 window()->SetProperty(aura::client::kModalKey, modal_type); 312 window()->SetProperty(aura::client::kModalKey, modal_type);
319 } 313 }
320 314
321 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) { 315 void DesktopWindowTreeHostMus::FlashFrame(bool flash_frame) {
322 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame); 316 window()->SetProperty(aura::client::kDrawAttentionKey, flash_frame);
323 } 317 }
324 318
(...skipping 11 matching lines...) Expand all
336 Widget* widget = native_widget_delegate_->AsWidget(); 330 Widget* widget = native_widget_delegate_->AsWidget();
337 window()->SetProperty(aura::client::kCanMaximizeKey, 331 window()->SetProperty(aura::client::kCanMaximizeKey,
338 widget->widget_delegate()->CanMaximize()); 332 widget->widget_delegate()->CanMaximize());
339 window()->SetProperty(aura::client::kCanMinimizeKey, 333 window()->SetProperty(aura::client::kCanMinimizeKey,
340 widget->widget_delegate()->CanMinimize()); 334 widget->widget_delegate()->CanMinimize());
341 window()->SetProperty(aura::client::kCanResizeKey, 335 window()->SetProperty(aura::client::kCanResizeKey,
342 widget->widget_delegate()->CanResize()); 336 widget->widget_delegate()->CanResize());
343 } 337 }
344 338
345 } // namespace views 339 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698