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

Side by Side Diff: mojo/ui/view_provider_app.cc

Issue 2020453003: Convert ViewProviderApp and ContentViewerApp to implement ApplicationImplBase instead of Applicatio… (Closed) Base URL: https://github.com/domokit/mojo.git@work796_no_run_main_app
Patch Set: Created 4 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 | « mojo/ui/view_provider_app.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mojo/ui/view_provider_app.h" 5 #include "mojo/ui/view_provider_app.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "mojo/public/cpp/application/service_provider_impl.h"
9 10
10 namespace mojo { 11 namespace mojo {
11 namespace ui { 12 namespace ui {
12 13
13 class ViewProviderApp::DelegatingViewProvider : public mojo::ui::ViewProvider { 14 class ViewProviderApp::DelegatingViewProvider : public mojo::ui::ViewProvider {
14 public: 15 public:
15 DelegatingViewProvider(ViewProviderApp* app, 16 DelegatingViewProvider(ViewProviderApp* app,
16 const std::string& view_provider_url) 17 const std::string& view_provider_url)
17 : app_(app), view_provider_url_(view_provider_url) {} 18 : app_(app), view_provider_url_(view_provider_url) {}
18 19
(...skipping 11 matching lines...) Expand all
30 ViewProviderApp* app_; 31 ViewProviderApp* app_;
31 std::string view_provider_url_; 32 std::string view_provider_url_;
32 33
33 MOJO_DISALLOW_COPY_AND_ASSIGN(DelegatingViewProvider); 34 MOJO_DISALLOW_COPY_AND_ASSIGN(DelegatingViewProvider);
34 }; 35 };
35 36
36 ViewProviderApp::ViewProviderApp() {} 37 ViewProviderApp::ViewProviderApp() {}
37 38
38 ViewProviderApp::~ViewProviderApp() {} 39 ViewProviderApp::~ViewProviderApp() {}
39 40
40 void ViewProviderApp::Initialize(mojo::ApplicationImpl* app_impl) { 41 void ViewProviderApp::OnInitialize() {
41 app_impl_ = app_impl;
42
43 auto command_line = base::CommandLine::ForCurrentProcess(); 42 auto command_line = base::CommandLine::ForCurrentProcess();
44 command_line->InitFromArgv(app_impl_->args()); 43 command_line->InitFromArgv(args());
45 logging::LoggingSettings settings; 44 logging::LoggingSettings settings;
46 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 45 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
47 logging::InitLogging(settings); 46 logging::InitLogging(settings);
48 } 47 }
49 48
50 bool ViewProviderApp::ConfigureIncomingConnection( 49 bool ViewProviderApp::OnAcceptConnection(
51 ServiceProviderImpl* service_provider_impl) { 50 ServiceProviderImpl* service_provider_impl) {
52 service_provider_impl->AddService<ViewProvider>( 51 service_provider_impl->AddService<ViewProvider>(
53 [this](const ConnectionContext& connection_context, 52 [this](const ConnectionContext& connection_context,
54 InterfaceRequest<ViewProvider> view_provider_request) { 53 InterfaceRequest<ViewProvider> view_provider_request) {
55 bindings_.AddBinding( 54 bindings_.AddBinding(
56 new DelegatingViewProvider(this, connection_context.connection_url), 55 new DelegatingViewProvider(this, connection_context.connection_url),
57 view_provider_request.Pass()); 56 view_provider_request.Pass());
58 }); 57 });
59 return true; 58 return true;
60 } 59 }
61 60
62 void ViewProviderApp::CreateView( 61 void ViewProviderApp::CreateView(
63 DelegatingViewProvider* provider, 62 DelegatingViewProvider* provider,
64 const std::string& view_provider_url, 63 const std::string& view_provider_url,
65 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request, 64 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
66 mojo::InterfaceRequest<mojo::ServiceProvider> services) { 65 mojo::InterfaceRequest<mojo::ServiceProvider> services) {
67 CreateView(view_provider_url, view_owner_request.Pass(), services.Pass()); 66 CreateView(view_provider_url, view_owner_request.Pass(), services.Pass());
68 } 67 }
69 68
70 } // namespace ui 69 } // namespace ui
71 } // namespace mojo 70 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/ui/view_provider_app.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698