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

Side by Side Diff: mash/simple_wm/simple_wm.cc

Issue 2548513002: Update bool WindowManager::OnWmSetBounds() to match with its desirable behavior. (Closed)
Patch Set: Remove if condition statetment in Window::SetBounds(const gfx::Rect& new_bounds). 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 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 "mash/simple_wm/simple_wm.h" 5 #include "mash/simple_wm/simple_wm.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/display/screen_base.h" 9 #include "ui/display/screen_base.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 aura::PropertyConverter* SimpleWM::GetPropertyConverter() { 132 aura::PropertyConverter* SimpleWM::GetPropertyConverter() {
133 return &property_converter_; 133 return &property_converter_;
134 } 134 }
135 135
136 void SimpleWM::SetWindowManagerClient( 136 void SimpleWM::SetWindowManagerClient(
137 aura::WindowManagerClient* client) { 137 aura::WindowManagerClient* client) {
138 window_manager_client_ = client; 138 window_manager_client_ = client;
139 } 139 }
140 140
141 bool SimpleWM::OnWmSetBounds(aura::Window* window, gfx::Rect* bounds) { 141 void SimpleWM::OnWmSetBounds(aura::Window* window, const gfx::Rect& bounds) {
142 FrameView* frame_view = GetFrameViewForClientWindow(window); 142 FrameView* frame_view = GetFrameViewForClientWindow(window);
143 frame_view->GetWidget()->SetBounds(*bounds); 143 frame_view->GetWidget()->SetBounds(bounds);
144 return true;
145 } 144 }
146 145
147 bool SimpleWM::OnWmSetProperty( 146 bool SimpleWM::OnWmSetProperty(
148 aura::Window* window, 147 aura::Window* window,
149 const std::string& name, 148 const std::string& name,
150 std::unique_ptr<std::vector<uint8_t>>* new_data) { 149 std::unique_ptr<std::vector<uint8_t>>* new_data) {
151 return true; 150 return true;
152 } 151 }
153 152
154 aura::Window* SimpleWM::OnWmCreateTopLevelWindow( 153 aura::Window* SimpleWM::OnWmCreateTopLevelWindow(
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 const std::vector<gfx::Rect>& additional_client_areas) {} 235 const std::vector<gfx::Rect>& additional_client_areas) {}
237 236
238 SimpleWM::FrameView* SimpleWM::GetFrameViewForClientWindow( 237 SimpleWM::FrameView* SimpleWM::GetFrameViewForClientWindow(
239 aura::Window* client_window) { 238 aura::Window* client_window) {
240 auto it = client_window_to_frame_view_.find(client_window); 239 auto it = client_window_to_frame_view_.find(client_window);
241 return it != client_window_to_frame_view_.end() ? it->second : nullptr; 240 return it != client_window_to_frame_view_.end() ? it->second : nullptr;
242 } 241 }
243 242
244 } // namespace simple_wm 243 } // namespace simple_wm
245 244
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698