| 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/android/router/media_router_dialog_controller_and
roid.h" | 5 #include "chrome/browser/media/android/router/media_router_dialog_controller_and
roid.h" |
| 6 | 6 |
| 7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "chrome/browser/media/android/router/media_router_android.h" | 10 #include "chrome/browser/media/android/router/media_router_android.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 env, java_dialog_controller_.obj()); | 144 env, java_dialog_controller_.obj()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 bool MediaRouterDialogControllerAndroid::IsShowingMediaRouterDialog() const { | 147 bool MediaRouterDialogControllerAndroid::IsShowingMediaRouterDialog() const { |
| 148 JNIEnv* env = base::android::AttachCurrentThread(); | 148 JNIEnv* env = base::android::AttachCurrentThread(); |
| 149 return Java_ChromeMediaRouterDialogController_isShowingDialog( | 149 return Java_ChromeMediaRouterDialogController_isShowingDialog( |
| 150 env, java_dialog_controller_.obj()); | 150 env, java_dialog_controller_.obj()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void MediaRouterDialogControllerAndroid::OnRoutesUpdated( | 153 void MediaRouterDialogControllerAndroid::OnRoutesUpdated( |
| 154 const std::vector<MediaRoute>& routes) { | 154 const std::vector<MediaRoute>& routes, |
| 155 const std::vector<MediaRoute::Id>& joinable_route_ids) { |
| 156 // Android does not currently support joinable non-local routes. |
| 157 DCHECK(joinable_route_ids.empty()); |
| 158 |
| 155 if (routes.size() != 1) { | 159 if (routes.size() != 1) { |
| 156 single_existing_route_.reset(); | 160 single_existing_route_.reset(); |
| 157 return; | 161 return; |
| 158 } | 162 } |
| 159 | 163 |
| 160 if (single_existing_route_.get() && | 164 if (single_existing_route_.get() && |
| 161 single_existing_route_->media_route_id() == routes[0].media_route_id()) { | 165 single_existing_route_->media_route_id() == routes[0].media_route_id()) { |
| 162 return; | 166 return; |
| 163 } | 167 } |
| 164 | 168 |
| 165 single_existing_route_.reset(new MediaRoute(routes[0])); | 169 single_existing_route_.reset(new MediaRoute(routes[0])); |
| 166 } | 170 } |
| 167 | 171 |
| 168 } // namespace media_router | 172 } // namespace media_router |
| 169 | 173 |
| OLD | NEW |