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

Side by Side Diff: ash/mus/window_manager.cc

Issue 2548513002: Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. (Closed)
Patch Set: change bool to void. Created 4 years 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 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 "ash/mus/window_manager.h" 5 #include "ash/mus/window_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event, 298 void WindowManager::OnPointerEventObserved(const ui::PointerEvent& event,
299 ui::Window* target) { 299 ui::Window* target) {
300 pointer_watcher_event_router_->OnPointerEventObserved(event, target); 300 pointer_watcher_event_router_->OnPointerEventObserved(event, target);
301 } 301 }
302 302
303 void WindowManager::SetWindowManagerClient(ui::WindowManagerClient* client) { 303 void WindowManager::SetWindowManagerClient(ui::WindowManagerClient* client) {
304 window_manager_client_ = client; 304 window_manager_client_ = client;
305 } 305 }
306 306
307 bool WindowManager::OnWmSetBounds(ui::Window* window, gfx::Rect* bounds) { 307 void WindowManager::OnWmSetBounds(ui::Window* window, gfx::Rect* bounds) {
308 // TODO(sky): this indirectly sets bounds, which is against what 308 // TODO(sky): this indirectly sets bounds, which is against what
309 // OnWmSetBounds() recommends doing. Remove that restriction, or fix this. 309 // OnWmSetBounds() recommends doing. Remove that restriction, or fix this.
310 WmWindowMus::Get(window)->SetBounds(*bounds); 310 WmWindowMus::Get(window)->SetBounds(*bounds);
311 *bounds = window->bounds();
312 return true;
313 } 311 }
314 312
315 bool WindowManager::OnWmSetProperty( 313 bool WindowManager::OnWmSetProperty(
316 ui::Window* window, 314 ui::Window* window,
317 const std::string& name, 315 const std::string& name,
318 std::unique_ptr<std::vector<uint8_t>>* new_data) { 316 std::unique_ptr<std::vector<uint8_t>>* new_data) {
319 // TODO(sky): constrain this to set of keys we know about, and allowed values. 317 // TODO(sky): constrain this to set of keys we know about, and allowed values.
320 return name == ui::mojom::WindowManager::kAppIcon_Property || 318 return name == ui::mojom::WindowManager::kAppIcon_Property ||
321 name == ui::mojom::WindowManager::kShowState_Property || 319 name == ui::mojom::WindowManager::kShowState_Property ||
322 name == ui::mojom::WindowManager::kPreferredSize_Property || 320 name == ui::mojom::WindowManager::kPreferredSize_Property ||
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 const ui::Event& event) { 390 const ui::Event& event) {
393 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id)); 391 auto iter = accelerator_handlers_.find(GetAcceleratorNamespaceId(id));
394 if (iter == accelerator_handlers_.end()) 392 if (iter == accelerator_handlers_.end())
395 return ui::mojom::EventResult::HANDLED; 393 return ui::mojom::EventResult::HANDLED;
396 394
397 return iter->second->OnAccelerator(id, event); 395 return iter->second->OnAccelerator(id, event);
398 } 396 }
399 397
400 } // namespace mus 398 } // namespace mus
401 } // namespace ash 399 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698