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

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

Issue 1510603003: [Media Router] Add UMA metrics for Media Router Dialog WebUI performance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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_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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return current_route_request_id_ != -1; 114 return current_route_request_id_ != -1;
115 } 115 }
116 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; } 116 const std::vector<MediaSinkWithCastModes>& sinks() const { return sinks_; }
117 const std::vector<MediaRoute>& routes() const { return routes_; } 117 const std::vector<MediaRoute>& routes() const { return routes_; }
118 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; } 118 const std::set<MediaCastMode>& cast_modes() const { return cast_modes_; }
119 const content::WebContents* initiator() const { return initiator_; } 119 const content::WebContents* initiator() const { return initiator_; }
120 120
121 // Marked virtual for tests. 121 // Marked virtual for tests.
122 virtual const std::string& GetRouteProviderExtensionId() const; 122 virtual const std::string& GetRouteProviderExtensionId() const;
123 123
124 // Called to track UI metrics.
125 void SetUIInitializationTimer(const base::Time& start_time);
126 void OnUIInitiallyLoaded();
127 void OnUIInitialDataReceived();
128
124 private: 129 private:
125 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 130 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
126 UIMediaRoutesObserverFiltersNonDisplayRoutes); 131 UIMediaRoutesObserverFiltersNonDisplayRoutes);
127 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent); 132 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, GetExtensionNameExtensionPresent);
128 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 133 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
129 GetExtensionNameEmptyWhenNotInstalled); 134 GetExtensionNameEmptyWhenNotInstalled);
130 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest, 135 FRIEND_TEST_ALL_PREFIXES(MediaRouterUITest,
131 GetExtensionNameEmptyWhenNotExtensionURL); 136 GetExtensionNameEmptyWhenNotExtensionURL);
132 137
133 class UIIssuesObserver; 138 class UIIssuesObserver;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::WeakPtr<PresentationServiceDelegateImpl> presentation_service_delegate_; 241 base::WeakPtr<PresentationServiceDelegateImpl> presentation_service_delegate_;
237 242
238 content::WebContents* initiator_; 243 content::WebContents* initiator_;
239 244
240 // Pointer to the MediaRouter for this instance's BrowserContext. 245 // Pointer to the MediaRouter for this instance's BrowserContext.
241 MediaRouterMojoImpl* router_; 246 MediaRouterMojoImpl* router_;
242 247
243 // Timer used to implement a timeout on a create route request. 248 // Timer used to implement a timeout on a create route request.
244 base::OneShotTimer route_creation_timer_; 249 base::OneShotTimer route_creation_timer_;
245 250
251 // The start time for UI initialization metrics timer. When a dialog has been
252 // been painted and initialized with initial data, this should be cleared.
253 base::Time start_time_;
254
246 // NOTE: Weak pointers must be invalidated before all other member variables. 255 // NOTE: Weak pointers must be invalidated before all other member variables.
247 // Therefore |weak_factory_| must be placed at the end. 256 // Therefore |weak_factory_| must be placed at the end.
248 base::WeakPtrFactory<MediaRouterUI> weak_factory_; 257 base::WeakPtrFactory<MediaRouterUI> weak_factory_;
249 258
250 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI); 259 DISALLOW_COPY_AND_ASSIGN(MediaRouterUI);
251 }; 260 };
252 261
253 } // namespace media_router 262 } // namespace media_router
254 263
255 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_ 264 #endif // CHROME_BROWSER_UI_WEBUI_MEDIA_ROUTER_MEDIA_ROUTER_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698