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