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

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

Issue 1121783003: Move navigations with POST or referrer to the shell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 7 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 URLResponsePtr response, 46 URLResponsePtr response,
47 Setup* setup) 47 Setup* setup)
48 : url_(response->url), 48 : url_(response->url),
49 binding_(this, request.Pass()), 49 binding_(this, request.Pass()),
50 initial_response_(response.Pass()), 50 initial_response_(response.Pass()),
51 setup_(setup) {} 51 setup_(setup) {}
52 52
53 void Initialize(ShellPtr shell, const String& url) override { 53 void Initialize(ShellPtr shell, const String& url) override {
54 ServiceProviderPtr service_provider; 54 ServiceProviderPtr service_provider;
55 shell_ = shell.Pass(); 55 shell_ = shell.Pass();
56 shell_->ConnectToApplication("mojo:network_service", 56 mojo::URLRequestPtr request(mojo::URLRequest::New());
57 request->url = mojo::String::From("mojo:network_service");
58 shell_->ConnectToApplication(request.Pass(),
57 GetProxy(&service_provider), nullptr); 59 GetProxy(&service_provider), nullptr);
58 ConnectToService(service_provider.get(), &network_service_); 60 ConnectToService(service_provider.get(), &network_service_);
59 } 61 }
60 62
61 void AcceptConnection(const String& requestor_url, 63 void AcceptConnection(const String& requestor_url,
62 InterfaceRequest<ServiceProvider> services, 64 InterfaceRequest<ServiceProvider> services,
63 ServiceProviderPtr exposed_services, 65 ServiceProviderPtr exposed_services,
64 const String& url) override { 66 const String& url) override {
65 if (initial_response_) { 67 if (initial_response_) {
66 OnResponseReceived(URLLoaderPtr(), services.Pass(), 68 OnResponseReceived(URLLoaderPtr(), services.Pass(),
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 159
158 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); 160 DISALLOW_COPY_AND_ASSIGN(HTMLViewer);
159 }; 161 };
160 162
161 } // namespace html_viewer 163 } // namespace html_viewer
162 164
163 MojoResult MojoMain(MojoHandle shell_handle) { 165 MojoResult MojoMain(MojoHandle shell_handle) {
164 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer); 166 mojo::ApplicationRunner runner(new html_viewer::HTMLViewer);
165 return runner.Run(shell_handle); 167 return runner.Run(shell_handle);
166 } 168 }
OLDNEW
« no previous file with comments | « components/html_viewer/html_document.cc ('k') | components/html_viewer/web_media_player_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698