| 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/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 "examples/browser/browser_host.mojom.h" | 8 #include "examples/browser/browser_host.mojom.h" |
| 9 #include "examples/window_manager/window_manager.mojom.h" | 9 #include "examples/window_manager/window_manager.mojom.h" |
| 10 #include "mojo/application/application_runner_chromium.h" | 10 #include "mojo/application/application_runner_chromium.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void OnViewDestroyed(View* view) override { | 98 void OnViewDestroyed(View* view) override { |
| 99 DCHECK_EQ(root_, view); | 99 DCHECK_EQ(root_, view); |
| 100 view->RemoveObserver(this); | 100 view->RemoveObserver(this); |
| 101 root_ = NULL; | 101 root_ = NULL; |
| 102 } | 102 } |
| 103 | 103 |
| 104 // examples::BrowserHost: | 104 // examples::BrowserHost: |
| 105 void NavigateTo(const mojo::String& url) override { | 105 void NavigateTo(const mojo::String& url) override { |
| 106 URLRequestPtr request(URLRequest::New()); | 106 URLRequestPtr request(URLRequest::New()); |
| 107 request->url = url; | 107 request->url = url; |
| 108 navigator_host_->RequestNavigate(TARGET_NEW_NODE, request.Pass()); | 108 navigator_host_->RequestNavigate(Target::NEW_NODE, request.Pass()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // mojo::InterfaceFactory<examples::BrowserHost> implementation. | 111 // mojo::InterfaceFactory<examples::BrowserHost> implementation. |
| 112 void Create(mojo::ApplicationConnection* connection, | 112 void Create(mojo::ApplicationConnection* connection, |
| 113 mojo::InterfaceRequest<examples::BrowserHost> request) override { | 113 mojo::InterfaceRequest<examples::BrowserHost> request) override { |
| 114 binding_.Bind(request.Pass()); | 114 binding_.Bind(request.Pass()); |
| 115 } | 115 } |
| 116 | 116 |
| 117 Shell* shell_; | 117 Shell* shell_; |
| 118 | 118 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 129 DISALLOW_COPY_AND_ASSIGN(Browser); | 129 DISALLOW_COPY_AND_ASSIGN(Browser); |
| 130 }; | 130 }; |
| 131 | 131 |
| 132 } // namespace examples | 132 } // namespace examples |
| 133 } // namespace mojo | 133 } // namespace mojo |
| 134 | 134 |
| 135 MojoResult MojoMain(MojoHandle application_request) { | 135 MojoResult MojoMain(MojoHandle application_request) { |
| 136 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); | 136 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); |
| 137 return runner.Run(application_request); | 137 return runner.Run(application_request); |
| 138 } | 138 } |
| OLD | NEW |