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

Side by Side Diff: mojo/examples/browser/browser.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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
9 #include "mojo/common/common_type_converters.h" 9 #include "mojo/common/common_type_converters.h"
10 #include "mojo/converters/geometry/geometry_type_converters.h" 10 #include "mojo/converters/geometry/geometry_type_converters.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 views::Background::CreateSolidBackground(SK_ColorBLUE)); 187 views::Background::CreateSolidBackground(SK_ColorBLUE));
188 widget_delegate->GetContentsView()->AddChildView(textfield); 188 widget_delegate->GetContentsView()->AddChildView(textfield);
189 widget_delegate->GetContentsView()->SetLayoutManager( 189 widget_delegate->GetContentsView()->SetLayoutManager(
190 new BrowserLayoutManager); 190 new BrowserLayoutManager);
191 191
192 widget_ = new views::Widget; 192 widget_ = new views::Widget;
193 views::Widget::InitParams params( 193 views::Widget::InitParams params(
194 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 194 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
195 params.native_widget = new NativeWidgetViewManager(widget_, shell_, view); 195 params.native_widget = new NativeWidgetViewManager(widget_, shell_, view);
196 params.delegate = widget_delegate; 196 params.delegate = widget_delegate;
197 params.bounds = gfx::Rect(view->bounds().width(), view->bounds().height()); 197 params.bounds = gfx::Rect(view->bounds().width, view->bounds().height);
198 widget_->Init(params); 198 widget_->Init(params);
199 // KeyboardManager handles deleting itself when the widget is destroyed. 199 // KeyboardManager handles deleting itself when the widget is destroyed.
200 new KeyboardManager(widget_, window_manager_.get(), view); 200 new KeyboardManager(widget_, window_manager_.get(), view);
201 widget_->Show(); 201 widget_->Show();
202 textfield->RequestFocus(); 202 textfield->RequestFocus();
203 } 203 }
204 204
205 // ViewManagerDelegate: 205 // ViewManagerDelegate:
206 virtual void OnEmbed(ViewManager* view_manager, 206 virtual void OnEmbed(ViewManager* view_manager,
207 View* root, 207 View* root,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 DISALLOW_COPY_AND_ASSIGN(Browser); 265 DISALLOW_COPY_AND_ASSIGN(Browser);
266 }; 266 };
267 267
268 } // namespace examples 268 } // namespace examples
269 } // namespace mojo 269 } // namespace mojo
270 270
271 MojoResult MojoMain(MojoHandle shell_handle) { 271 MojoResult MojoMain(MojoHandle shell_handle) {
272 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); 272 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser);
273 return runner.Run(shell_handle); 273 return runner.Run(shell_handle);
274 } 274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698