| 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/media/router/media_router_dialog_controller.h" | 5 #include "chrome/browser/media/router/media_router_dialog_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/media/router/media_router_metrics.h" | 9 #include "chrome/browser/media/router/media_router_metrics.h" |
| 10 #include "chrome/common/features.h" | 10 #include "chrome/common/features.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 13 #include "content/public/browser/web_contents_delegate.h" | 13 #include "content/public/browser/web_contents_delegate.h" |
| 14 | 14 |
| 15 #if BUILDFLAG(ANDROID_JAVA_UI) | 15 #if defined(OS_ANDROID) |
| 16 #include "chrome/browser/media/android/router/media_router_dialog_controller_and
roid.h" | 16 #include "chrome/browser/media/android/router/media_router_dialog_controller_and
roid.h" |
| 17 #else | 17 #else |
| 18 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im
pl.h" | 18 #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_im
pl.h" |
| 19 #endif | 19 #endif |
| 20 | 20 |
| 21 namespace media_router { | 21 namespace media_router { |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 MediaRouterDialogController* | 24 MediaRouterDialogController* |
| 25 MediaRouterDialogController::GetOrCreateForWebContents( | 25 MediaRouterDialogController::GetOrCreateForWebContents( |
| 26 content::WebContents* contents) { | 26 content::WebContents* contents) { |
| 27 #if BUILDFLAG(ANDROID_JAVA_UI) | 27 #if defined(OS_ANDROID) |
| 28 return MediaRouterDialogControllerAndroid::GetOrCreateForWebContents( | 28 return MediaRouterDialogControllerAndroid::GetOrCreateForWebContents( |
| 29 contents); | 29 contents); |
| 30 #else | 30 #else |
| 31 return MediaRouterDialogControllerImpl::GetOrCreateForWebContents(contents); | 31 return MediaRouterDialogControllerImpl::GetOrCreateForWebContents(contents); |
| 32 #endif | 32 #endif |
| 33 } | 33 } |
| 34 | 34 |
| 35 class MediaRouterDialogController::InitiatorWebContentsObserver | 35 class MediaRouterDialogController::InitiatorWebContentsObserver |
| 36 : public content::WebContentsObserver { | 36 : public content::WebContentsObserver { |
| 37 public: | 37 public: |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 MediaRouterDialogController::TakeCreateConnectionRequest() { | 116 MediaRouterDialogController::TakeCreateConnectionRequest() { |
| 117 return std::move(create_connection_request_); | 117 return std::move(create_connection_request_); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void MediaRouterDialogController::Reset() { | 120 void MediaRouterDialogController::Reset() { |
| 121 initiator_observer_.reset(); | 121 initiator_observer_.reset(); |
| 122 create_connection_request_.reset(); | 122 create_connection_request_.reset(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 } // namespace media_router | 125 } // namespace media_router |
| OLD | NEW |