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

Side by Side Diff: mojo/services/html_viewer/html_viewer.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
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/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "mojo/public/cpp/application/application_connection.h" 6 #include "mojo/public/cpp/application/application_connection.h"
7 #include "mojo/public/cpp/application/application_delegate.h" 7 #include "mojo/public/cpp/application/application_delegate.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/services/html_viewer/blink_platform_impl.h" 9 #include "mojo/services/html_viewer/blink_platform_impl.h"
10 #include "mojo/services/html_viewer/html_document_view.h" 10 #include "mojo/services/html_viewer/html_document_view.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 GetServiceProvider(), view_manager); 76 GetServiceProvider(), view_manager);
77 document_view_->AttachToNode(root); 77 document_view_->AttachToNode(root);
78 MaybeLoad(); 78 MaybeLoad();
79 } 79 }
80 virtual void OnViewManagerDisconnected( 80 virtual void OnViewManagerDisconnected(
81 view_manager::ViewManager* view_manager) OVERRIDE { 81 view_manager::ViewManager* view_manager) OVERRIDE {
82 base::MessageLoop::current()->Quit(); 82 base::MessageLoop::current()->Quit();
83 } 83 }
84 84
85 void MaybeLoad() { 85 void MaybeLoad() {
86 if (document_view_ && response_.get()) 86 if (document_view_ && response_)
87 document_view_->Load(response_.Pass()); 87 document_view_->Load(response_.Pass());
88 } 88 }
89 89
90 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_; 90 scoped_ptr<BlinkPlatformImpl> blink_platform_impl_;
91 ApplicationImpl* application_impl_; 91 ApplicationImpl* application_impl_;
92 92
93 // TODO(darin): Figure out proper ownership of this instance. 93 // TODO(darin): Figure out proper ownership of this instance.
94 HTMLDocumentView* document_view_; 94 HTMLDocumentView* document_view_;
95 URLResponsePtr response_; 95 URLResponsePtr response_;
96 96
97 DISALLOW_COPY_AND_ASSIGN(HTMLViewer); 97 DISALLOW_COPY_AND_ASSIGN(HTMLViewer);
98 }; 98 };
99 99
100 void NavigatorImpl::Navigate( 100 void NavigatorImpl::Navigate(
101 uint32_t node_id, 101 uint32_t node_id,
102 navigation::NavigationDetailsPtr navigation_details, 102 navigation::NavigationDetailsPtr navigation_details,
103 navigation::ResponseDetailsPtr response_details) { 103 navigation::ResponseDetailsPtr response_details) {
104 viewer_->Load(response_details->response.Pass()); 104 viewer_->Load(response_details->response.Pass());
105 } 105 }
106 106
107 // static 107 // static
108 ApplicationDelegate* ApplicationDelegate::Create() { 108 ApplicationDelegate* ApplicationDelegate::Create() {
109 return new HTMLViewer; 109 return new HTMLViewer;
110 } 110 }
111 111
112 } 112 }
OLDNEW
« no previous file with comments | « mojo/services/gles2/command_buffer_impl.cc ('k') | mojo/services/native_viewport/native_viewport_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698