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

Side by Side Diff: ash/aura/wm_window_aura.cc

Issue 2462753002: Use Ash's ShelfWindowWatcher for app panel windows. (Closed)
Patch Set: Add ShelfWindowWatcherTest, remove ChromeLauncherControllerImplTest panel use. 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 "ash/aura/wm_window_aura.h" 5 #include "ash/aura/wm_window_aura.h"
6 6
7 #include "ash/aura/aura_layout_manager_adapter.h" 7 #include "ash/aura/aura_layout_manager_adapter.h"
8 #include "ash/aura/wm_root_window_controller_aura.h" 8 #include "ash/aura/wm_root_window_controller_aura.h"
9 #include "ash/aura/wm_shell_aura.h" 9 #include "ash/aura/wm_shell_aura.h"
10 #include "ash/common/ash_constants.h" 10 #include "ash/common/ash_constants.h"
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return; 360 return;
361 } 361 }
362 if (key == WmWindowProperty::TOP_VIEW_INSET) { 362 if (key == WmWindowProperty::TOP_VIEW_INSET) {
363 window_->SetProperty(aura::client::kTopViewInset, value); 363 window_->SetProperty(aura::client::kTopViewInset, value);
364 return; 364 return;
365 } 365 }
366 366
367 NOTREACHED(); 367 NOTREACHED();
368 } 368 }
369 369
370 gfx::ImageSkia WmWindowAura::GetWindowIcon() {
371 gfx::ImageSkia* image = window_->GetProperty(aura::client::kWindowIconKey);
372 return image ? *image : gfx::ImageSkia();
373 }
374
375 gfx::ImageSkia WmWindowAura::GetAppIcon() {
376 gfx::ImageSkia* image = window_->GetProperty(aura::client::kAppIconKey);
377 return image ? *image : gfx::ImageSkia();
378 }
379
370 const wm::WindowState* WmWindowAura::GetWindowState() const { 380 const wm::WindowState* WmWindowAura::GetWindowState() const {
371 return ash::wm::GetWindowState(window_); 381 return ash::wm::GetWindowState(window_);
372 } 382 }
373 383
374 WmWindow* WmWindowAura::GetToplevelWindow() { 384 WmWindow* WmWindowAura::GetToplevelWindow() {
375 return Get(window_->GetToplevelWindow()); 385 return Get(window_->GetToplevelWindow());
376 } 386 }
377 387
378 WmWindow* WmWindowAura::GetToplevelWindowForFocus() { 388 WmWindow* WmWindowAura::GetToplevelWindowForFocus() {
379 return Get(::wm::GetToplevelWindow(window_)); 389 return Get(::wm::GetToplevelWindow(window_));
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 void WmWindowAura::OnWindowPropertyChanged(aura::Window* window, 842 void WmWindowAura::OnWindowPropertyChanged(aura::Window* window,
833 const void* key, 843 const void* key,
834 intptr_t old) { 844 intptr_t old) {
835 if (key == aura::client::kShowStateKey) { 845 if (key == aura::client::kShowStateKey) {
836 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged(); 846 ash::wm::GetWindowState(window_)->OnWindowShowStateChanged();
837 return; 847 return;
838 } 848 }
839 WmWindowProperty wm_property; 849 WmWindowProperty wm_property;
840 if (key == aura::client::kAlwaysOnTopKey) { 850 if (key == aura::client::kAlwaysOnTopKey) {
841 wm_property = WmWindowProperty::ALWAYS_ON_TOP; 851 wm_property = WmWindowProperty::ALWAYS_ON_TOP;
852 } else if (key == aura::client::kAppIconKey) {
853 wm_property = WmWindowProperty::APP_ICON;
842 } else if (key == aura::client::kExcludeFromMruKey) { 854 } else if (key == aura::client::kExcludeFromMruKey) {
843 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; 855 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU;
844 } else if (key == aura::client::kModalKey) { 856 } else if (key == aura::client::kModalKey) {
845 wm_property = WmWindowProperty::MODAL_TYPE; 857 wm_property = WmWindowProperty::MODAL_TYPE;
846 } else if (key == kShelfIconResourceIdKey) { 858 } else if (key == kShelfIconResourceIdKey) {
847 wm_property = WmWindowProperty::SHELF_ICON_RESOURCE_ID; 859 wm_property = WmWindowProperty::SHELF_ICON_RESOURCE_ID;
848 } else if (key == kShelfIDKey) { 860 } else if (key == kShelfIDKey) {
849 wm_property = WmWindowProperty::SHELF_ID; 861 wm_property = WmWindowProperty::SHELF_ID;
850 } else if (key == kShelfItemTypeKey) { 862 } else if (key == kShelfItemTypeKey) {
851 wm_property = WmWindowProperty::SHELF_ITEM_TYPE; 863 wm_property = WmWindowProperty::SHELF_ITEM_TYPE;
852 } else if (key == kSnapChildrenToPixelBoundary) { 864 } else if (key == kSnapChildrenToPixelBoundary) {
853 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY; 865 wm_property = WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY;
854 } else if (key == aura::client::kTopViewInset) { 866 } else if (key == aura::client::kTopViewInset) {
855 wm_property = WmWindowProperty::TOP_VIEW_INSET; 867 wm_property = WmWindowProperty::TOP_VIEW_INSET;
868 } else if (key == aura::client::kWindowIconKey) {
869 wm_property = WmWindowProperty::WINDOW_ICON;
856 } else { 870 } else {
857 return; 871 return;
858 } 872 }
859 for (auto& observer : observers_) 873 for (auto& observer : observers_)
860 observer.OnWindowPropertyChanged(this, wm_property); 874 observer.OnWindowPropertyChanged(this, wm_property);
861 } 875 }
862 876
863 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, 877 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window,
864 const gfx::Rect& old_bounds, 878 const gfx::Rect& old_bounds,
865 const gfx::Rect& new_bounds) { 879 const gfx::Rect& new_bounds) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 observer.OnTransientChildAdded(this, Get(transient)); 915 observer.OnTransientChildAdded(this, Get(transient));
902 } 916 }
903 917
904 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, 918 void WmWindowAura::OnTransientChildRemoved(aura::Window* window,
905 aura::Window* transient) { 919 aura::Window* transient) {
906 for (auto& observer : transient_observers_) 920 for (auto& observer : transient_observers_)
907 observer.OnTransientChildRemoved(this, Get(transient)); 921 observer.OnTransientChildRemoved(this, Get(transient));
908 } 922 }
909 923
910 } // namespace ash 924 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698