OLD | NEW |
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/basictypes.h" | 5 #include "base/basictypes.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/examples/window_manager/window_manager.mojom.h" | 10 #include "mojo/examples/window_manager/window_manager.mojom.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 root_(NULL), | 159 root_(NULL), |
160 widget_(NULL) {} | 160 widget_(NULL) {} |
161 | 161 |
162 virtual ~Browser() { | 162 virtual ~Browser() { |
163 if (root_) | 163 if (root_) |
164 root_->RemoveObserver(this); | 164 root_->RemoveObserver(this); |
165 } | 165 } |
166 | 166 |
167 private: | 167 private: |
168 // Overridden from ApplicationDelegate: | 168 // Overridden from ApplicationDelegate: |
169 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { | 169 virtual void Initialize(ApplicationImpl* app) override { |
170 view_manager_client_factory_.reset( | 170 view_manager_client_factory_.reset( |
171 new ViewManagerClientFactory(app->shell(), this)); | 171 new ViewManagerClientFactory(app->shell(), this)); |
172 views_init_.reset(new ViewsInit); | 172 views_init_.reset(new ViewsInit); |
173 app->ConnectToService("mojo:mojo_window_manager", &window_manager_); | 173 app->ConnectToService("mojo:mojo_window_manager", &window_manager_); |
174 } | 174 } |
175 | 175 |
176 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 176 virtual bool ConfigureIncomingConnection( |
177 MOJO_OVERRIDE { | 177 ApplicationConnection* connection) override { |
178 connection->AddService(view_manager_client_factory_.get()); | 178 connection->AddService(view_manager_client_factory_.get()); |
179 return true; | 179 return true; |
180 } | 180 } |
181 | 181 |
182 void CreateWidget(View* view) { | 182 void CreateWidget(View* view) { |
183 views::Textfield* textfield = new views::Textfield; | 183 views::Textfield* textfield = new views::Textfield; |
184 textfield->set_controller(this); | 184 textfield->set_controller(this); |
185 | 185 |
186 views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView; | 186 views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView; |
187 widget_delegate->GetContentsView()->set_background( | 187 widget_delegate->GetContentsView()->set_background( |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 DISALLOW_COPY_AND_ASSIGN(Browser); | 264 DISALLOW_COPY_AND_ASSIGN(Browser); |
265 }; | 265 }; |
266 | 266 |
267 } // namespace examples | 267 } // namespace examples |
268 } // namespace mojo | 268 } // namespace mojo |
269 | 269 |
270 MojoResult MojoMain(MojoHandle shell_handle) { | 270 MojoResult MojoMain(MojoHandle shell_handle) { |
271 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); | 271 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); |
272 return runner.Run(shell_handle); | 272 return runner.Run(shell_handle); |
273 } | 273 } |
OLD | NEW |