| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_android.h" | 5 #include "chrome/browser/android/tab_android.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 "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" | 10 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 if (!settings->IsBlockageIndicated(CONTENT_SETTINGS_TYPE_POPUPS)) { | 201 if (!settings->IsBlockageIndicated(CONTENT_SETTINGS_TYPE_POPUPS)) { |
| 202 // TODO(dfalcantara): Create an InfoBarDelegate to keep the | 202 // TODO(dfalcantara): Create an InfoBarDelegate to keep the |
| 203 // PopupBlockedInfoBar logic native-side instead of straddling the JNI | 203 // PopupBlockedInfoBar logic native-side instead of straddling the JNI |
| 204 // boundary. | 204 // boundary. |
| 205 int num_popups = 0; | 205 int num_popups = 0; |
| 206 PopupBlockerTabHelper* popup_blocker_helper = | 206 PopupBlockerTabHelper* popup_blocker_helper = |
| 207 PopupBlockerTabHelper::FromWebContents(web_contents()); | 207 PopupBlockerTabHelper::FromWebContents(web_contents()); |
| 208 if (popup_blocker_helper) | 208 if (popup_blocker_helper) |
| 209 num_popups = popup_blocker_helper->GetBlockedPopupsCount(); | 209 num_popups = popup_blocker_helper->GetBlockedPopupsCount(); |
| 210 | 210 |
| 211 if (num_popups > 0) { | 211 if (num_popups > 0) |
| 212 PopupBlockedInfoBarDelegate::Create( | 212 PopupBlockedInfoBarDelegate::Create(web_contents(), num_popups); |
| 213 InfoBarService::FromWebContents(web_contents()), | |
| 214 num_popups); | |
| 215 } | |
| 216 | 213 |
| 217 settings->SetBlockageHasBeenIndicated(CONTENT_SETTINGS_TYPE_POPUPS); | 214 settings->SetBlockageHasBeenIndicated(CONTENT_SETTINGS_TYPE_POPUPS); |
| 218 } | 215 } |
| 219 break; | 216 break; |
| 220 } | 217 } |
| 221 case chrome::NOTIFICATION_FAVICON_UPDATED: | 218 case chrome::NOTIFICATION_FAVICON_UPDATED: |
| 222 Java_TabBase_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); | 219 Java_TabBase_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); |
| 223 break; | 220 break; |
| 224 default: | 221 default: |
| 225 NOTREACHED() << "Unexpected notification " << type; | 222 NOTREACHED() << "Unexpected notification " << type; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 370 |
| 374 static void Init(JNIEnv* env, jobject obj) { | 371 static void Init(JNIEnv* env, jobject obj) { |
| 375 TRACE_EVENT0("native", "TabAndroid::Init"); | 372 TRACE_EVENT0("native", "TabAndroid::Init"); |
| 376 // This will automatically bind to the Java object and pass ownership there. | 373 // This will automatically bind to the Java object and pass ownership there. |
| 377 new TabAndroid(env, obj); | 374 new TabAndroid(env, obj); |
| 378 } | 375 } |
| 379 | 376 |
| 380 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 377 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
| 381 return RegisterNativesImpl(env); | 378 return RegisterNativesImpl(env); |
| 382 } | 379 } |
| OLD | NEW |