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

Side by Side Diff: mojo/examples/wm_flow/wm/wm.cc

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "mojo/application/application_runner_chromium.h" 7 #include "mojo/application/application_runner_chromium.h"
8 #include "mojo/examples/wm_flow/wm/frame_controller.h" 8 #include "mojo/examples/wm_flow/wm/frame_controller.h"
9 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
10 #include "mojo/public/cpp/application/application_delegate.h" 10 #include "mojo/public/cpp/application/application_delegate.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 169
170 void CloseWindow(mojo::View* view) { 170 void CloseWindow(mojo::View* view) {
171 mojo::View* first_child = view->children().front(); 171 mojo::View* first_child = view->children().front();
172 first_child->Destroy(); 172 first_child->Destroy();
173 view->Destroy(); 173 view->Destroy();
174 next_window_origin_.Offset(-50, -50); 174 next_window_origin_.Offset(-50, -50);
175 } 175 }
176 176
177 mojo::View* CreateTopLevelWindow(mojo::View** app_view) { 177 mojo::View* CreateTopLevelWindow(mojo::View** app_view) {
178 mojo::View* frame_view = mojo::View::Create(view_manager_); 178 mojo::View* frame_view = mojo::View::Create(view_manager_);
179 frame_view->SetBounds(gfx::Rect(next_window_origin_, gfx::Size(400, 400))); 179 mojo::Rect rect;
180 rect.x = next_window_origin_.x();
181 rect.y = next_window_origin_.y();
182 rect.width = rect.height = 400;
183 frame_view->SetBounds(rect);
180 next_window_origin_.Offset(50, 50); 184 next_window_origin_.Offset(50, 50);
181 185
182 aura::client::ActivationClient* client = aura::client::GetActivationClient( 186 aura::client::ActivationClient* client = aura::client::GetActivationClient(
183 window_manager_app_->host()->window()); 187 window_manager_app_->host()->window());
184 new FrameController( 188 new FrameController(
185 shell_, frame_view, app_view, client, window_manager_app_.get()); 189 shell_, frame_view, app_view, client, window_manager_app_.get());
186 return frame_view; 190 return frame_view;
187 } 191 }
188 192
189 mojo::Shell* shell_; 193 mojo::Shell* shell_;
(...skipping 10 matching lines...) Expand all
200 204
201 DISALLOW_COPY_AND_ASSIGN(SimpleWM); 205 DISALLOW_COPY_AND_ASSIGN(SimpleWM);
202 }; 206 };
203 207
204 } // namespace examples 208 } // namespace examples
205 209
206 MojoResult MojoMain(MojoHandle shell_handle) { 210 MojoResult MojoMain(MojoHandle shell_handle) {
207 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM); 211 mojo::ApplicationRunnerChromium runner(new examples::SimpleWM);
208 return runner.Run(shell_handle); 212 return runner.Run(shell_handle);
209 } 213 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698