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

Side by Side Diff: examples/png_viewer/png_viewer.cc

Issue 858103002: Remove [Client=] annotation from ServiceProvider (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase for trybots (no code changes from ps2) Created 5 years, 11 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 | « examples/pdf_viewer/pdf_viewer.cc ('k') | examples/recipes/window_manager/main.cc » ('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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_tokenizer.h" 10 #include "base/strings/string_tokenizer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 // Overridden from ApplicationDelegate: 85 // Overridden from ApplicationDelegate:
86 virtual bool ConfigureIncomingConnection( 86 virtual bool ConfigureIncomingConnection(
87 ApplicationConnection* connection) override { 87 ApplicationConnection* connection) override {
88 connection->AddService(view_manager_client_factory_.get()); 88 connection->AddService(view_manager_client_factory_.get());
89 return true; 89 return true;
90 } 90 }
91 91
92 // Overridden from ViewManagerDelegate: 92 // Overridden from ViewManagerDelegate:
93 virtual void OnEmbed(View* root, 93 virtual void OnEmbed(View* root,
94 ServiceProviderImpl* exported_services, 94 InterfaceRequest<ServiceProvider> services,
95 scoped_ptr<ServiceProvider> imported_services) override { 95 ServiceProviderPtr exposed_services) override {
96 // TODO(qsr): The same view should be embeddable on multiple views. 96 // TODO(qsr): The same view should be embeddable on multiple views.
97 DCHECK(embedder_for_roots_.find(root) == embedder_for_roots_.end()); 97 DCHECK(embedder_for_roots_.find(root) == embedder_for_roots_.end());
98 root->AddObserver(this); 98 root->AddObserver(this);
99 EmbedderData* embedder_data = new EmbedderData(app_->shell(), root); 99 EmbedderData* embedder_data = new EmbedderData(app_->shell(), root);
100 embedder_for_roots_[root] = embedder_data; 100 embedder_for_roots_[root] = embedder_data;
101 embedder_data->bitmap_uploader().SetBitmap( 101 embedder_data->bitmap_uploader().SetBitmap(
102 width_, height_, 102 width_, height_,
103 make_scoped_ptr(new std::vector<unsigned char>(*bitmap_)), 103 make_scoped_ptr(new std::vector<unsigned char>(*bitmap_)),
104 BitmapUploader::BGRA); 104 BitmapUploader::BGRA);
105 } 105 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 DISALLOW_COPY_AND_ASSIGN(PNGViewer); 220 DISALLOW_COPY_AND_ASSIGN(PNGViewer);
221 }; 221 };
222 222
223 } // namespace examples 223 } // namespace examples
224 } // namespace mojo 224 } // namespace mojo
225 225
226 MojoResult MojoMain(MojoHandle shell_handle) { 226 MojoResult MojoMain(MojoHandle shell_handle) {
227 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer()); 227 mojo::ApplicationRunnerChromium runner(new mojo::examples::PNGViewer());
228 return runner.Run(shell_handle); 228 return runner.Run(shell_handle);
229 } 229 }
OLDNEW
« no previous file with comments | « examples/pdf_viewer/pdf_viewer.cc ('k') | examples/recipes/window_manager/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698