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 // This call does nothing if the controller already exists. |
| 109 MediaRouterDialogController::CreateForWebContents(web_contents); |
| 110 return MediaRouterDialogController::FromWebContents(web_contents); |
| 111 } |
| 112 |
103 class MediaRouterDialogController::DialogWebContentsObserver | 113 class MediaRouterDialogController::DialogWebContentsObserver |
104 : public content::WebContentsObserver { | 114 : public content::WebContentsObserver { |
105 public: | 115 public: |
106 DialogWebContentsObserver( | 116 DialogWebContentsObserver( |
107 WebContents* web_contents, | 117 WebContents* web_contents, |
108 MediaRouterDialogController* dialog_controller) | 118 MediaRouterDialogController* dialog_controller) |
109 : content::WebContentsObserver(web_contents), | 119 : content::WebContentsObserver(web_contents), |
110 dialog_controller_(dialog_controller) { | 120 dialog_controller_(dialog_controller) { |
111 } | 121 } |
112 | 122 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 << "transition_type: " << transition_type << ", " | 282 << "transition_type: " << transition_type << ", " |
273 << "nav_type: " << nav_type; | 283 << "nav_type: " << nav_type; |
274 | 284 |
275 media_router_dialog_pending_ = false; | 285 media_router_dialog_pending_ = false; |
276 | 286 |
277 // TODO(imcheng): Initialize dialog. | 287 // TODO(imcheng): Initialize dialog. |
278 } | 288 } |
279 | 289 |
280 } // namespace media_router | 290 } // namespace media_router |
281 | 291 |
OLD | NEW |