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

Unified Diff: content/renderer/presentation/presentation_dispatcher.h

Issue 1131053005: [Presentation API] Convert screen availability API into Client style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix dcheck 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/presentation/presentation_dispatcher.h
diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
index ffd7e58bcfca1decbc629f3e3238262d30f28608..89f6b9f13053b4e54b954fd7f823fc3af030cb83 100644
--- a/content/renderer/presentation/presentation_dispatcher.h
+++ b/content/renderer/presentation/presentation_dispatcher.h
@@ -22,7 +22,8 @@ namespace content {
// Blink. It forwards the calls to the Mojo PresentationService.
class CONTENT_EXPORT PresentationDispatcher
: public RenderFrameObserver,
- public NON_EXPORTED_BASE(blink::WebPresentationClient) {
+ public NON_EXPORTED_BASE(blink::WebPresentationClient),
+ public NON_EXPORTED_BASE(presentation::PresentationServiceClient) {
public:
explicit PresentationDispatcher(RenderFrame* render_frame);
~PresentationDispatcher() override;
@@ -59,9 +60,9 @@ class CONTENT_EXPORT PresentationDispatcher
bool is_new_navigation,
bool is_same_page_navigation) override;
- void OnScreenAvailabilityChanged(
- const std::string& presentation_url,
- bool available);
+ // presentation::PresentationServiceClient
+ void OnScreenAvailabilityUpdated(bool available) override;
+
void OnSessionCreated(
blink::WebPresentationSessionClientCallbacks* callback,
presentation::PresentationSessionInfoPtr session_info,
@@ -73,25 +74,23 @@ class CONTENT_EXPORT PresentationDispatcher
presentation::PresentationSessionState session_state);
void OnSessionMessagesReceived(
mojo::Array<presentation::SessionMessagePtr> messages);
-
- void ConnectToPresentationServiceIfNeeded();
-
- void DoUpdateAvailableChangeWatched(
- const std::string& presentation_url,
- bool watched);
-
void DoSendMessage(const presentation::SessionMessage& session_message);
void HandleSendMessageRequests(bool success);
+ void ConnectToPresentationServiceIfNeeded();
+
// Used as a weak reference. Can be null since lifetime is bound to the frame.
blink::WebPresentationController* controller_;
presentation::PresentationServicePtr presentation_service_;
+ mojo::Binding<presentation::PresentationServiceClient> binding_;
// Message requests are queued here and only one message at a time is sent
// over mojo channel.
using MessageRequestQueue =
std::queue<linked_ptr<presentation::SessionMessage>>;
MessageRequestQueue message_request_queue_;
+
+ DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher);
};
} // namespace content
« no previous file with comments | « content/common/presentation/presentation_service.mojom ('k') | content/renderer/presentation/presentation_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698