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

Side by Side Diff: mash/wm/window_manager_application.cc

Issue 1456233002: Converts remaining windowmanager property based functions to SetProperty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « components/mus/ws/window_tree_impl.cc ('k') | mash/wm/window_manager_apptest.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/wm/window_manager_application.h" 5 #include "mash/wm/window_manager_application.h"
6 6
7 #include "components/mus/common/util.h" 7 #include "components/mus/common/util.h"
8 #include "components/mus/public/cpp/window.h" 8 #include "components/mus/public/cpp/window.h"
9 #include "components/mus/public/cpp/window_tree_connection.h" 9 #include "components/mus/public/cpp/window_tree_connection.h"
10 #include "components/mus/public/cpp/window_tree_host_factory.h" 10 #include "components/mus/public/cpp/window_tree_host_factory.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // By returning true the bounds of |window| is updated. 99 // By returning true the bounds of |window| is updated.
100 return true; 100 return true;
101 } 101 }
102 102
103 bool WindowManagerApplication::OnWmSetProperty( 103 bool WindowManagerApplication::OnWmSetProperty(
104 mus::Window* window, 104 mus::Window* window,
105 const std::string& name, 105 const std::string& name,
106 scoped_ptr<std::vector<uint8_t>>* new_data) { 106 scoped_ptr<std::vector<uint8_t>>* new_data) {
107 // TODO(sky): constrain this to set of keys we know about, and allowed 107 // TODO(sky): constrain this to set of keys we know about, and allowed
108 // values. 108 // values.
109 return name == mus::mojom::WindowManager::kShowState_Property; 109 return name == mus::mojom::WindowManager::kShowState_Property ||
110 name == mus::mojom::WindowManager::kPreferredSize_Property ||
111 name == mus::mojom::WindowManager::kResizeBehavior_Property;
110 } 112 }
111 113
112 void WindowManagerApplication::CreateContainers() { 114 void WindowManagerApplication::CreateContainers() {
113 for (uint16_t container = static_cast<uint16_t>( 115 for (uint16_t container = static_cast<uint16_t>(
114 mash::wm::mojom::CONTAINER_ALL_USER_BACKGROUND); 116 mash::wm::mojom::CONTAINER_ALL_USER_BACKGROUND);
115 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT); 117 container < static_cast<uint16_t>(mash::wm::mojom::CONTAINER_COUNT);
116 ++container) { 118 ++container) {
117 mus::Window* window = root_->connection()->NewWindow(); 119 mus::Window* window = root_->connection()->NewWindow();
118 DCHECK_EQ(mus::LoWord(window->id()), container) 120 DCHECK_EQ(mus::LoWord(window->id()), container)
119 << "Containers must be created before other windows!"; 121 << "Containers must be created before other windows!";
120 window->SetBounds(root_->bounds()); 122 window->SetBounds(root_->bounds());
121 window->SetVisible(true); 123 window->SetVisible(true);
122 root_->AddChild(window); 124 root_->AddChild(window);
123 } 125 }
124 } 126 }
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree_impl.cc ('k') | mash/wm/window_manager_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698