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

Side by Side Diff: components/html_viewer/html_viewer.cc

Issue 1166123005: Removes ServiceProviders from ViewManager::Embed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use is_headless rather than check for browser. Created 5 years, 6 months 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
« no previous file with comments | « components/html_viewer/html_document.cc ('k') | components/html_viewer/setup.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/bind.h" 5 #include "base/bind.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 ~HTMLViewer() override {} 155 ~HTMLViewer() override {}
156 156
157 private: 157 private:
158 // Overridden from ApplicationDelegate: 158 // Overridden from ApplicationDelegate:
159 void Initialize(mojo::ApplicationImpl* app) override { 159 void Initialize(mojo::ApplicationImpl* app) override {
160 app_ = app; 160 app_ = app;
161 setup_.reset(new Setup(app)); 161 setup_.reset(new Setup(app));
162 } 162 }
163 163
164 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { 164 bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
165 // If we're not being connected to from the view manager assume we're being
166 // run in tests, or a headless environment, in which case we'll never get a
167 // ui and there is no point in waiting for it.
168 if (connection->GetRemoteApplicationURL() != "mojo://view_manager/" &&
169 !setup_->did_init()) {
170 setup_->InitHeadless();
171 }
172 connection->AddService(this); 165 connection->AddService(this);
173 return true; 166 return true;
174 } 167 }
175 168
176 // Overridden from InterfaceFactory<ContentHandler> 169 // Overridden from InterfaceFactory<ContentHandler>
177 void Create(ApplicationConnection* connection, 170 void Create(ApplicationConnection* connection,
178 mojo::InterfaceRequest<ContentHandler> request) override { 171 mojo::InterfaceRequest<ContentHandler> request) override {
179 new ContentHandlerImpl(setup_.get(), app_, request.Pass()); 172 new ContentHandlerImpl(setup_.get(), app_, request.Pass());
180 } 173 }
181 174
182 scoped_ptr<Setup> setup_; 175 scoped_ptr<Setup> setup_;
183 mojo::ApplicationImpl* app_; 176 mojo::ApplicationImpl* app_;
184 177
185 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); 178 DISALLOW_COPY_AND_ASSIGN(HTMLViewer);
186 }; 179 };
187 180
188 } // namespace html_viewer 181 } // namespace html_viewer
189 182
190 MojoResult MojoMain(MojoHandle shell_handle) { 183 MojoResult MojoMain(MojoHandle shell_handle) {
191 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); 184 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer);
192 return runner.Run(shell_handle); 185 return runner.Run(shell_handle);
193 } 186 }
OLDNEW
« no previous file with comments | « components/html_viewer/html_document.cc ('k') | components/html_viewer/setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698