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 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller.h" | 5 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 #if defined(OS_MACOSX) | 93 #if defined(OS_MACOSX) |
94 *size = gfx::Size(330, 400); | 94 *size = gfx::Size(330, 400); |
95 #else | 95 #else |
96 // size is not used because the dialog is auto-resizeable. | 96 // size is not used because the dialog is auto-resizeable. |
97 *size = gfx::Size(); | 97 *size = gfx::Size(); |
98 #endif | 98 #endif |
99 } | 99 } |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 // static | |
104 MediaRouterDialogController* | |
105 MediaRouterDialogController::GetOrCreateForWebContents( | |
106 WebContents* web_contents) { | |
107 DCHECK(web_contents); | |
108 MediaRouterDialogController* controller = | |
109 media_router::MediaRouterDialogController::FromWebContents(web_contents); | |
Peter Kasting
2015/06/04 00:17:53
Nit: media_router:: namespace qualifier not necess
imcheng (use chromium acct)
2015/06/04 01:04:20
Done.
| |
110 if (controller) | |
111 return controller; | |
112 | |
113 MediaRouterDialogController::CreateForWebContents(web_contents); | |
114 controller = MediaRouterDialogController::FromWebContents(web_contents); | |
115 DCHECK(controller); | |
116 return controller; | |
Peter Kasting
2015/06/04 00:17:53
Nit: This function is more verbose than it needs t
imcheng (use chromium acct)
2015/06/04 01:04:20
My reasoning was that although CreateForWebContent
| |
117 } | |
118 | |
103 class MediaRouterDialogController::DialogWebContentsObserver | 119 class MediaRouterDialogController::DialogWebContentsObserver |
104 : public content::WebContentsObserver { | 120 : public content::WebContentsObserver { |
105 public: | 121 public: |
106 DialogWebContentsObserver( | 122 DialogWebContentsObserver( |
107 WebContents* web_contents, | 123 WebContents* web_contents, |
108 MediaRouterDialogController* dialog_controller) | 124 MediaRouterDialogController* dialog_controller) |
109 : content::WebContentsObserver(web_contents), | 125 : content::WebContentsObserver(web_contents), |
110 dialog_controller_(dialog_controller) { | 126 dialog_controller_(dialog_controller) { |
111 } | 127 } |
112 | 128 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
272 << "transition_type: " << transition_type << ", " | 288 << "transition_type: " << transition_type << ", " |
273 << "nav_type: " << nav_type; | 289 << "nav_type: " << nav_type; |
274 | 290 |
275 media_router_dialog_pending_ = false; | 291 media_router_dialog_pending_ = false; |
276 | 292 |
277 // TODO(imcheng): Initialize dialog. | 293 // TODO(imcheng): Initialize dialog. |
278 } | 294 } |
279 | 295 |
280 } // namespace media_router | 296 } // namespace media_router |
281 | 297 |
OLD | NEW |