Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Side by Side Diff: chrome/browser/media/android/router/media_router_dialog_controller_android.cc

Issue 1415103006: Non-Local Join for Media Router and Presentation API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review Fixes 2 Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
mark a. foltz 2015/12/09 00:48:16 Maybe DCHECK(joinable_route_ids.empty())
matt.boetger 2015/12/15 19:21:20 Done.
155 if (routes.size() != 1) { 157 if (routes.size() != 1) {
156 single_existing_route_.reset(); 158 single_existing_route_.reset();
157 return; 159 return;
158 } 160 }
159 161
160 if (single_existing_route_.get() && 162 if (single_existing_route_.get() &&
161 single_existing_route_->media_route_id() == routes[0].media_route_id()) { 163 single_existing_route_->media_route_id() == routes[0].media_route_id()) {
162 return; 164 return;
163 } 165 }
164 166
165 single_existing_route_.reset(new MediaRoute(routes[0])); 167 single_existing_route_.reset(new MediaRoute(routes[0]));
166 } 168 }
167 169
168 } // namespace media_router 170 } // namespace media_router
169 171
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698