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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_dialog_controller.h

Issue 1149893020: [Media Router] Implement MediaRouterAction + MediaRouterUI tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed pkasting's 2nd comments Created 5 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
11 11
12 namespace media_router { 12 namespace media_router {
13 13
14 // An instance of this class is tied to a WebContents known as the initiator, 14 // An instance of this class is tied to a WebContents known as the initiator,
15 // and is lazily created when a Media Router dialog needs to be shown. 15 // and is lazily created when a Media Router dialog needs to be shown.
16 // The MediaRouterDialogController allows creating, querying, and removing a 16 // The MediaRouterDialogController allows creating, querying, and removing a
17 // Media Router dialog modal to the initiator WebContents. 17 // Media Router dialog modal to the initiator WebContents.
18 // This class is not thread safe and must be called on the UI thread. 18 // This class is not thread safe and must be called on the UI thread.
19 class MediaRouterDialogController 19 class MediaRouterDialogController
20 : public content::WebContentsUserData<MediaRouterDialogController> { 20 : public content::WebContentsUserData<MediaRouterDialogController> {
21 public: 21 public:
22 ~MediaRouterDialogController() override; 22 ~MediaRouterDialogController() override;
23 23
24 // Gets a reference to the MediaRouterDialogController associated with
25 // |web_contents|, creating one if it does not exist. The returned pointer is
26 // guaranteed to be non-null.
27 static MediaRouterDialogController* GetOrCreateForWebContents(
28 content::WebContents* web_contents);
29
24 // Shows the media router dialog modal to the initiator WebContents. 30 // Shows the media router dialog modal to the initiator WebContents.
25 // Creates the dialog if it did not exist prior to this call. 31 // Creates the dialog if it did not exist prior to this call.
26 // If the dialog already exists, brings the dialog to the front. 32 // If the dialog already exists, brings the dialog to the front.
27 // Returns WebContents for the media router dialog. 33 // Returns WebContents for the media router dialog.
28 content::WebContents* ShowMediaRouterDialog(); 34 content::WebContents* ShowMediaRouterDialog();
29 35
30 // Returns the media router dialog WebContents. 36 // Returns the media router dialog WebContents.
31 // Returns nullptr if there is no dialog. 37 // Returns nullptr if there is no dialog.
32 content::WebContents* GetMediaRouterDialog() const; 38 content::WebContents* GetMediaRouterDialog() const;
33 39
(...skipping 30 matching lines...) Expand all
64 bool media_router_dialog_pending_; 70 bool media_router_dialog_pending_;
65 71
66 base::ThreadChecker thread_checker_; 72 base::ThreadChecker thread_checker_;
67 73
68 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogController); 74 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogController);
69 }; 75 };
70 76
71 } // namespace media_router 77 } // namespace media_router
72 78
73 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H _ 79 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698