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

Side by Side Diff: ash/mus/bridge/wm_window_mus.cc

Issue 2411913003: Converts ash/wm/mru_window_tracker_unittest.cc to use AshTest (Closed)
Patch Set: comment Created 4 years, 2 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/mus/bridge/wm_shell_mus.cc ('k') | ash/mus/property_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/mus/bridge/wm_window_mus.h" 5 #include "ash/mus/bridge/wm_window_mus.h"
6 6
7 #include "ash/common/shelf/shelf_item_types.h" 7 #include "ash/common/shelf/shelf_item_types.h"
8 #include "ash/common/wm/container_finder.h" 8 #include "ash/common/wm/container_finder.h"
9 #include "ash/common/wm/window_positioning_utils.h" 9 #include "ash/common/wm/window_positioning_utils.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 default: 97 default:
98 break; 98 break;
99 } 99 }
100 return ui::mojom::ShowState::DEFAULT; 100 return ui::mojom::ShowState::DEFAULT;
101 } 101 }
102 102
103 // Returns the WmWindowProperty enum value for the given ui::Window key name. 103 // Returns the WmWindowProperty enum value for the given ui::Window key name.
104 WmWindowProperty WmWindowPropertyFromUI(const std::string& ui_window_key) { 104 WmWindowProperty WmWindowPropertyFromUI(const std::string& ui_window_key) {
105 if (ui_window_key == ui::mojom::WindowManager::kAlwaysOnTop_Property) 105 if (ui_window_key == ui::mojom::WindowManager::kAlwaysOnTop_Property)
106 return WmWindowProperty::ALWAYS_ON_TOP; 106 return WmWindowProperty::ALWAYS_ON_TOP;
107 if (ui_window_key == ui::mojom::WindowManager::kExcludeFromMru_Property)
108 return WmWindowProperty::EXCLUDE_FROM_MRU;
107 if (ui_window_key == ui::mojom::WindowManager::kShelfIconResourceId_Property) 109 if (ui_window_key == ui::mojom::WindowManager::kShelfIconResourceId_Property)
108 return WmWindowProperty::SHELF_ICON_RESOURCE_ID; 110 return WmWindowProperty::SHELF_ICON_RESOURCE_ID;
109 if (ui_window_key == ui::mojom::WindowManager::kShelfItemType_Property) 111 if (ui_window_key == ui::mojom::WindowManager::kShelfItemType_Property)
110 return WmWindowProperty::SHELF_ITEM_TYPE; 112 return WmWindowProperty::SHELF_ITEM_TYPE;
111 return WmWindowProperty::INVALID_PROPERTY; 113 return WmWindowProperty::INVALID_PROPERTY;
112 } 114 }
113 115
114 } // namespace 116 } // namespace
115 117
116 WmWindowMus::WmWindowMus(ui::Window* window) 118 WmWindowMus::WmWindowMus(ui::Window* window)
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 return gfx::Transform(); 366 return gfx::Transform();
365 } 367 }
366 368
367 bool WmWindowMus::IsSystemModal() const { 369 bool WmWindowMus::IsSystemModal() const {
368 NOTIMPLEMENTED(); 370 NOTIMPLEMENTED();
369 return false; 371 return false;
370 } 372 }
371 373
372 bool WmWindowMus::GetBoolProperty(WmWindowProperty key) { 374 bool WmWindowMus::GetBoolProperty(WmWindowProperty key) {
373 switch (key) { 375 switch (key) {
374 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY:
375 return snap_children_to_pixel_boundary_;
376
377 case WmWindowProperty::ALWAYS_ON_TOP: 376 case WmWindowProperty::ALWAYS_ON_TOP:
378 return IsAlwaysOnTop(); 377 return IsAlwaysOnTop();
379 378
380 case WmWindowProperty::EXCLUDE_FROM_MRU: 379 case WmWindowProperty::EXCLUDE_FROM_MRU:
381 NOTIMPLEMENTED(); 380 return GetExcludeFromMru(window_);
382 return false; 381
382 case WmWindowProperty::SNAP_CHILDREN_TO_PIXEL_BOUNDARY:
383 return snap_children_to_pixel_boundary_;
383 384
384 default: 385 default:
385 NOTREACHED(); 386 NOTREACHED();
386 break; 387 break;
387 } 388 }
388 389
389 NOTREACHED(); 390 NOTREACHED();
390 return false; 391 return false;
391 } 392 }
392 393
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 void WmWindowMus::Minimize() { 830 void WmWindowMus::Minimize() {
830 SetWindowShowState(window_, ui::mojom::ShowState::MINIMIZED); 831 SetWindowShowState(window_, ui::mojom::ShowState::MINIMIZED);
831 } 832 }
832 833
833 void WmWindowMus::Unminimize() { 834 void WmWindowMus::Unminimize() {
834 SetWindowShowState(window_, MojomWindowShowStateFromUI(restore_show_state_)); 835 SetWindowShowState(window_, MojomWindowShowStateFromUI(restore_show_state_));
835 restore_show_state_ = ui::SHOW_STATE_DEFAULT; 836 restore_show_state_ = ui::SHOW_STATE_DEFAULT;
836 } 837 }
837 838
838 void WmWindowMus::SetExcludedFromMru(bool excluded_from_mru) { 839 void WmWindowMus::SetExcludedFromMru(bool excluded_from_mru) {
839 NOTIMPLEMENTED(); 840 SetExcludeFromMru(window_, excluded_from_mru);
840 } 841 }
841 842
842 std::vector<WmWindow*> WmWindowMus::GetChildren() { 843 std::vector<WmWindow*> WmWindowMus::GetChildren() {
843 return FromMusWindows(window_->children()); 844 return FromMusWindows(window_->children());
844 } 845 }
845 846
846 WmWindow* WmWindowMus::GetChildByShellWindowId(int id) { 847 WmWindow* WmWindowMus::GetChildByShellWindowId(int id) {
847 if (id == shell_window_id_) 848 if (id == shell_window_id_)
848 return this; 849 return this;
849 for (ui::Window* child : window_->children()) { 850 for (ui::Window* child : window_->children()) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 } 1021 }
1021 1022
1022 void WmWindowMus::OnTransientChildRemoved(ui::Window* window, 1023 void WmWindowMus::OnTransientChildRemoved(ui::Window* window,
1023 ui::Window* transient) { 1024 ui::Window* transient) {
1024 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_, 1025 FOR_EACH_OBSERVER(WmTransientWindowObserver, transient_observers_,
1025 OnTransientChildRemoved(this, Get(transient))); 1026 OnTransientChildRemoved(this, Get(transient)));
1026 } 1027 }
1027 1028
1028 } // namespace mus 1029 } // namespace mus
1029 } // namespace ash 1030 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/bridge/wm_shell_mus.cc ('k') | ash/mus/property_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698