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

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

Issue 2251843002: Add window property for restore bounds when virtual keyboard is enabled. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 return; 296 return;
297 } 297 }
298 if (key == WmWindowProperty::TOP_VIEW_INSET) { 298 if (key == WmWindowProperty::TOP_VIEW_INSET) {
299 window_->SetProperty(aura::client::kTopViewInset, value); 299 window_->SetProperty(aura::client::kTopViewInset, value);
300 return; 300 return;
301 } 301 }
302 302
303 NOTREACHED(); 303 NOTREACHED();
304 } 304 }
305 305
306 gfx::Rect* WmWindowAura::GetRectProperty(WmWindowProperty key) {
307 if (key == WmWindowProperty::VK_NEW_BOUNDS)
308 return window_->GetProperty(aura::client::kVKNewBoundsKey);
309
310 NOTREACHED();
311 return new gfx::Rect();
312 }
313
306 ShelfItemDetails* WmWindowAura::GetShelfItemDetails() { 314 ShelfItemDetails* WmWindowAura::GetShelfItemDetails() {
307 return window_->GetProperty(kShelfItemDetailsKey); 315 return window_->GetProperty(kShelfItemDetailsKey);
308 } 316 }
309 317
310 void WmWindowAura::SetShelfItemDetails(const ShelfItemDetails& details) { 318 void WmWindowAura::SetShelfItemDetails(const ShelfItemDetails& details) {
311 // |item_details| is owned by |window_|. 319 // |item_details| is owned by |window_|.
312 ShelfItemDetails* item_details = new ShelfItemDetails(details); 320 ShelfItemDetails* item_details = new ShelfItemDetails(details);
313 window_->SetProperty(kShelfItemDetailsKey, item_details); 321 window_->SetProperty(kShelfItemDetailsKey, item_details);
314 } 322 }
315 323
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 } else if (key == aura::client::kAlwaysOnTopKey) { 781 } else if (key == aura::client::kAlwaysOnTopKey) {
774 wm_property = WmWindowProperty::ALWAYS_ON_TOP; 782 wm_property = WmWindowProperty::ALWAYS_ON_TOP;
775 } else if (key == kShelfID) { 783 } else if (key == kShelfID) {
776 wm_property = WmWindowProperty::SHELF_ID; 784 wm_property = WmWindowProperty::SHELF_ID;
777 } else if (key == kShelfItemDetailsKey) { 785 } else if (key == kShelfItemDetailsKey) {
778 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS; 786 wm_property = WmWindowProperty::SHELF_ITEM_DETAILS;
779 } else if (key == aura::client::kTopViewInset) { 787 } else if (key == aura::client::kTopViewInset) {
780 wm_property = WmWindowProperty::TOP_VIEW_INSET; 788 wm_property = WmWindowProperty::TOP_VIEW_INSET;
781 } else if (key == aura::client::kExcludeFromMruKey) { 789 } else if (key == aura::client::kExcludeFromMruKey) {
782 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU; 790 wm_property = WmWindowProperty::EXCLUDE_FROM_MRU;
791 } else if (key == aura::client::kVKNewBoundsKey) {
792 wm_property = WmWindowProperty::VK_NEW_BOUNDS;
783 } else { 793 } else {
784 return; 794 return;
785 } 795 }
786 FOR_EACH_OBSERVER(WmWindowObserver, observers_, 796 FOR_EACH_OBSERVER(WmWindowObserver, observers_,
787 OnWindowPropertyChanged(this, wm_property)); 797 OnWindowPropertyChanged(this, wm_property));
788 } 798 }
789 799
790 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window, 800 void WmWindowAura::OnWindowBoundsChanged(aura::Window* window,
791 const gfx::Rect& old_bounds, 801 const gfx::Rect& old_bounds,
792 const gfx::Rect& new_bounds) { 802 const gfx::Rect& new_bounds) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 OnTransientChildAdded(this, Get(transient))); 834 OnTransientChildAdded(this, Get(transient)));
825 } 835 }
826 836
827 void WmWindowAura::OnTransientChildRemoved(aura::Window* window, 837 void WmWindowAura::OnTransientChildRemoved(aura::Window* window,
828 aura::Window* transient) { 838 aura::Window* transient) {
829 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, 839 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_,
830 OnTransientChildRemoved(this, Get(transient))); 840 OnTransientChildRemoved(this, Get(transient)));
831 } 841 }
832 842
833 } // namespace ash 843 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_window_aura.h ('k') | ash/common/wm_window.h » ('j') | ash/common/wm_window.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698