OLD | NEW |
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_IMPL
_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_IMPL
_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_IMPL
_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_IMPL
_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // MediaRouterDialogController: | 53 // MediaRouterDialogController: |
54 void CreateMediaRouterDialog() override; | 54 void CreateMediaRouterDialog() override; |
55 void CloseMediaRouterDialog() override; | 55 void CloseMediaRouterDialog() override; |
56 void Reset() override; | 56 void Reset() override; |
57 | 57 |
58 // Invoked when the dialog WebContents has navigated. | 58 // Invoked when the dialog WebContents has navigated. |
59 void OnDialogNavigated(const content::LoadCommittedDetails& details); | 59 void OnDialogNavigated(const content::LoadCommittedDetails& details); |
60 | 60 |
61 void PopulateDialog(content::WebContents* media_router_dialog); | 61 void PopulateDialog(content::WebContents* media_router_dialog); |
62 | 62 |
63 scoped_ptr<DialogWebContentsObserver> dialog_observer_; | 63 std::unique_ptr<DialogWebContentsObserver> dialog_observer_; |
64 | 64 |
65 // True if the controller is waiting for a new media router dialog to be | 65 // True if the controller is waiting for a new media router dialog to be |
66 // created. | 66 // created. |
67 bool media_router_dialog_pending_; | 67 bool media_router_dialog_pending_; |
68 | 68 |
69 // |action_| refers to the MediaRouterAction on the toolbar, rather than | 69 // |action_| refers to the MediaRouterAction on the toolbar, rather than |
70 // overflow menu. A MediaRouterAction is always created for the toolbar | 70 // overflow menu. A MediaRouterAction is always created for the toolbar |
71 // first. Any subsequent creations for the overflow menu will not be set as | 71 // first. Any subsequent creations for the overflow menu will not be set as |
72 // |action_|. | 72 // |action_|. |
73 // The lifetime of |action_| is dependent on the creation and destruction of | 73 // The lifetime of |action_| is dependent on the creation and destruction of |
74 // a browser window. The overflow menu's MediaRouterAction is only created | 74 // a browser window. The overflow menu's MediaRouterAction is only created |
75 // when the overflow menu is opened and destroyed when the menu is closed. | 75 // when the overflow menu is opened and destroyed when the menu is closed. |
76 base::WeakPtr<MediaRouterAction> action_; | 76 base::WeakPtr<MediaRouterAction> action_; |
77 | 77 |
78 base::WeakPtrFactory<MediaRouterDialogControllerImpl> weak_ptr_factory_; | 78 base::WeakPtrFactory<MediaRouterDialogControllerImpl> weak_ptr_factory_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerImpl); | 80 DISALLOW_COPY_AND_ASSIGN(MediaRouterDialogControllerImpl); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace media_router | 83 } // namespace media_router |
84 | 84 |
85 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_I
MPL_H_ | 85 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_DIALOG_CONTROLLER_I
MPL_H_ |
OLD | NEW |