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_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return current_route_request_id_ != -1; | 119 return current_route_request_id_ != -1; |
120 } | 120 } |
121 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; } | 121 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; } |
122 const std::vector<MediaRoute>& routes() const { return routes_; } | 122 const std::vector<MediaRoute>& routes() const { return routes_; } |
123 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; } | 123 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; } |
124 const content::WebContents* initiator() const { return initiator_; } | 124 const content::WebContents* initiator() const { return initiator_; } |
125 | 125 |
126 // Marked virtual for tests. | 126 // Marked virtual for tests. |
127 virtual const std::string& GetRouteProviderExtensionId() const; | 127 virtual const std::string& GetRouteProviderExtensionId() const; |
128 | 128 |
| 129 // Called to track UI metrics. |
| 130 void SetUIInitializationTimer(const base::Time& start_time); |
| 131 void OnUIInitiallyLoaded(); |
| 132 void OnUIInitialDataReceived(); |
| 133 |
129 private: | 134 private: |
130 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortedSinks); | 135 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, SortedSinks); |
131 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 136 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
132 UIMediaRoutesObserverFiltersNonDisplayRoutes); | 137 UIMediaRoutesObserverFiltersNonDisplayRoutes); |
133 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); | 138 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); |
134 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 139 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
135 GetExtensionNameEmptyWhenNotInstalled); | 140 GetExtensionNameEmptyWhenNotInstalled); |
136 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, | 141 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, |
137 GetExtensionNameEmptyWhenNotExtensionURL); | 142 GetExtensionNameEmptyWhenNotExtensionURL); |
138 | 143 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 base::WeakPtr<PresentationServiceDelegateImpl> presentation_service_delegate_; | 251 base::WeakPtr<PresentationServiceDelegateImpl> presentation_service_delegate_; |
247 | 252 |
248 content::WebContents* initiator_; | 253 content::WebContents* initiator_; |
249 | 254 |
250 // Pointer to the MediaRouter for this instance's BrowserContext. | 255 // Pointer to the MediaRouter for this instance's BrowserContext. |
251 MediaRouterMojoImpl* router_; | 256 MediaRouterMojoImpl* router_; |
252 | 257 |
253 // Timer used to implement a timeout on a create route request. | 258 // Timer used to implement a timeout on a create route request. |
254 base::OneShotTimer route_creation_timer_; | 259 base::OneShotTimer route_creation_timer_; |
255 | 260 |
| 261 // The start time for UI initialization metrics timer. When a dialog has been |
| 262 // been painted and initialized with initial data, this should be cleared. |
| 263 base::Time start_time_; |
| 264 |
256 // NOTE: Weak pointers must be invalidated before all other member variables. | 265 // NOTE: Weak pointers must be invalidated before all other member variables. |
257 // Therefore |weak_factory_| must be placed at the end. | 266 // Therefore |weak_factory_| must be placed at the end. |
258 base::WeakPtrFactory<MediaRouterUI> weak_factory_; | 267 base::WeakPtrFactory<MediaRouterUI> weak_factory_; |
259 | 268 |
260 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); | 269 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); |
261 }; | 270 }; |
262 | 271 |
263 } // namespace media_router | 272 } // namespace media_router |
264 | 273 |
265 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ | 274 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ |
OLD | NEW |