Chromium Code Reviews| 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_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 ~MediaRouterDialogController() = default; | |
|
imcheng
2015/07/13 22:04:14
Does this need to be virtual?
whywhat
2015/07/15 12:41:04
Done.
| |
| 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( | |
|
imcheng
2015/07/13 22:04:14
I see that for MediaRouterFactory we return either
whywhat
2015/07/15 12:41:04
Are you saying you prefer a clear ifdef in one fil
imcheng
2015/07/16 18:28:19
Yeah. I was thinking we can put the definition in
| |
| 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. | |
|
imcheng
2015/07/13 22:04:14
s/WebContents for the media router dialog/true ? S
whywhat
2015/07/15 12:41:04
Done.
| |
| 36 // Otherwise returns nullptr and |request| is deleted. | |
| 37 virtual bool ShowMediaRouterDialogForPresentation( | |
| 38 scoped_ptr<CreateSessionRequest> request) = 0; | |
| 39 }; | |
| 40 | |
| 41 } // namespace media_router | |
| 42 | |
| 43 #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ | |
| OLD | NEW |