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

Side by Side Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 2063863002: Use DCHECKs when observing only a single notification. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/android/tab_web_contents_delegate_android.h" 5 #include "chrome/browser/android/tab_web_contents_delegate_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 } 158 }
159 } 159 }
160 return false; 160 return false;
161 } 161 }
162 162
163 163
164 void TabWebContentsDelegateAndroid::Observe( 164 void TabWebContentsDelegateAndroid::Observe(
165 int type, 165 int type,
166 const content::NotificationSource& source, 166 const content::NotificationSource& source,
167 const content::NotificationDetails& details) { 167 const content::NotificationDetails& details) {
168 switch (type) { 168 DCHECK_EQ(chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, type);
169 case chrome::NOTIFICATION_FIND_RESULT_AVAILABLE: 169 OnFindResultAvailable(
170 OnFindResultAvailable( 170 content::Source<WebContents>(source).ptr(),
171 content::Source<WebContents>(source).ptr(), 171 content::Details<FindNotificationDetails>(details).ptr());
172 content::Details<FindNotificationDetails>(details).ptr());
173 break;
174 default:
175 NOTREACHED() << "Unexpected notification: " << type;
176 break;
177 }
178 } 172 }
179 173
180 blink::WebDisplayMode TabWebContentsDelegateAndroid::GetDisplayMode( 174 blink::WebDisplayMode TabWebContentsDelegateAndroid::GetDisplayMode(
181 const WebContents* web_contents) const { 175 const WebContents* web_contents) const {
182 JNIEnv* env = base::android::AttachCurrentThread(); 176 JNIEnv* env = base::android::AttachCurrentThread();
183 177
184 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 178 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
185 if (obj.is_null()) 179 if (obj.is_null())
186 return blink::WebDisplayModeUndefined; 180 return blink::WebDisplayModeUndefined;
187 181
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 jboolean IsCapturingVideo(JNIEnv* env, 476 jboolean IsCapturingVideo(JNIEnv* env,
483 const JavaParamRef<jclass>& clazz, 477 const JavaParamRef<jclass>& clazz,
484 const JavaParamRef<jobject>& java_web_contents) { 478 const JavaParamRef<jobject>& java_web_contents) {
485 content::WebContents* web_contents = 479 content::WebContents* web_contents =
486 content::WebContents::FromJavaWebContents(java_web_contents); 480 content::WebContents::FromJavaWebContents(java_web_contents);
487 scoped_refptr<MediaStreamCaptureIndicator> indicator = 481 scoped_refptr<MediaStreamCaptureIndicator> indicator =
488 MediaCaptureDevicesDispatcher::GetInstance()-> 482 MediaCaptureDevicesDispatcher::GetInstance()->
489 GetMediaStreamCaptureIndicator(); 483 GetMediaStreamCaptureIndicator();
490 return indicator->IsCapturingVideo(web_contents); 484 return indicator->IsCapturingVideo(web_contents);
491 } 485 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/background/background_mode_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698