OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/media/router/create_presentation_session_request.h" |
| 10 |
| 11 namespace content { |
| 12 class WebContents; |
| 13 } // namespace content |
| 14 |
| 15 namespace media_router { |
| 16 |
| 17 // An implementation of this interface is tied to a WebContents known as the |
| 18 // initiator, and is lazily created when a Media Router dialog needs to be |
| 19 // shown. The MediaRouterDialogController allows creating, querying, and |
| 20 // removing a Media Router dialog modal to the initiator WebContents. |
| 21 // This class is not thread safe and must be called on the UI thread. |
| 22 class MediaRouterDialogController { |
| 23 public: |
| 24 virtual ~MediaRouterDialogController() = default; |
| 25 |
| 26 // Gets a reference to the MediaRouterDialogController associated with |
| 27 // |web_contents|, creating one if it does not exist. The returned pointer is |
| 28 // guaranteed to be non-null. |
| 29 static MediaRouterDialogController* GetOrCreateForWebContents( |
| 30 content::WebContents* web_contents); |
| 31 |
| 32 // Creates a Media Router modal dialog using the initiator and parameters |
| 33 // specified in |request|. If the dialog already exists, brings the dialog |
| 34 // to the front, but does not change the dialog with |request|. |
| 35 // Returns WebContents for the media router dialog if a dialog was created. |
| 36 // Otherwise returns false and |request| is deleted. |
| 37 virtual bool ShowMediaRouterDialogForPresentation( |
| 38 scoped_ptr<CreatePresentationSessionRequest> request) = 0; |
| 39 }; |
| 40 |
| 41 } // namespace media_router |
| 42 |
| 43 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ |
OLD | NEW |