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

Side by Side Diff: mojo/examples/nesting_app/nesting_app.cc

Issue 405653003: mojo: Make InterfacePtr<> testable in if() statements without .get(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move to is_bound() Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/examples/window_manager/window_manager.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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "mojo/examples/window_manager/window_manager.mojom.h" 9 #include "mojo/examples/window_manager/window_manager.mojom.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 DISALLOW_COPY_AND_ASSIGN(Navigator); 65 DISALLOW_COPY_AND_ASSIGN(Navigator);
66 }; 66 };
67 67
68 // Overridden from ApplicationImpl: 68 // Overridden from ApplicationImpl:
69 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 69 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
70 MOJO_OVERRIDE { 70 MOJO_OVERRIDE {
71 ViewManager::ConfigureIncomingConnection(connection, this); 71 ViewManager::ConfigureIncomingConnection(connection, this);
72 connection->ConnectToService(&window_manager_); 72 connection->ConnectToService(&window_manager_);
73 connection->AddService<Navigator>(this); 73 connection->AddService<Navigator>(this);
74 // TODO(davemoore): Is this ok? 74 // TODO(davemoore): Is this ok?
75 if (!navigator_.get()) { 75 if (!navigator_) {
76 connection->ConnectToApplication( 76 connection->ConnectToApplication(
77 kEmbeddedAppURL)->ConnectToService(&navigator_); 77 kEmbeddedAppURL)->ConnectToService(&navigator_);
78 } 78 }
79 return true; 79 return true;
80 } 80 }
81 81
82 // Overridden from ViewManagerDelegate: 82 // Overridden from ViewManagerDelegate:
83 virtual void OnRootAdded(ViewManager* view_manager, Node* root) OVERRIDE { 83 virtual void OnRootAdded(ViewManager* view_manager, Node* root) OVERRIDE {
84 root->AddObserver(this); 84 root->AddObserver(this);
85 85
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 }; 134 };
135 135
136 } // namespace examples 136 } // namespace examples
137 137
138 // static 138 // static
139 ApplicationDelegate* ApplicationDelegate::Create() { 139 ApplicationDelegate* ApplicationDelegate::Create() {
140 return new examples::NestingApp; 140 return new examples::NestingApp;
141 } 141 }
142 142
143 } // namespace mojo 143 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/window_manager/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698