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 "chrome/browser/android/chrome_web_contents_delegate_android.h" | 9 #include "chrome/browser/android/chrome_web_contents_delegate_android.h" |
10 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 10 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 if (!settings->IsBlockageIndicated(CONTENT_SETTINGS_TYPE_POPUPS)) { | 260 if (!settings->IsBlockageIndicated(CONTENT_SETTINGS_TYPE_POPUPS)) { |
261 // TODO(dfalcantara): Create an InfoBarDelegate to keep the | 261 // TODO(dfalcantara): Create an InfoBarDelegate to keep the |
262 // PopupBlockedInfoBar logic native-side instead of straddling the JNI | 262 // PopupBlockedInfoBar logic native-side instead of straddling the JNI |
263 // boundary. | 263 // boundary. |
264 int num_popups = 0; | 264 int num_popups = 0; |
265 PopupBlockerTabHelper* popup_blocker_helper = | 265 PopupBlockerTabHelper* popup_blocker_helper = |
266 PopupBlockerTabHelper::FromWebContents(web_contents()); | 266 PopupBlockerTabHelper::FromWebContents(web_contents()); |
267 if (popup_blocker_helper) | 267 if (popup_blocker_helper) |
268 num_popups = popup_blocker_helper->GetBlockedPopupsCount(); | 268 num_popups = popup_blocker_helper->GetBlockedPopupsCount(); |
269 | 269 |
270 if (num_popups > 0) { | 270 if (num_popups > 0) |
271 PopupBlockedInfoBarDelegate::Create( | 271 PopupBlockedInfoBarDelegate::Create(web_contents(), num_popups); |
272 InfoBarService::FromWebContents(web_contents()), | |
273 num_popups); | |
274 } | |
275 | 272 |
276 settings->SetBlockageHasBeenIndicated(CONTENT_SETTINGS_TYPE_POPUPS); | 273 settings->SetBlockageHasBeenIndicated(CONTENT_SETTINGS_TYPE_POPUPS); |
277 } | 274 } |
278 break; | 275 break; |
279 } | 276 } |
280 case chrome::NOTIFICATION_FAVICON_UPDATED: | 277 case chrome::NOTIFICATION_FAVICON_UPDATED: |
281 Java_TabBase_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); | 278 Java_TabBase_onFaviconUpdated(env, weak_java_tab_.get(env).obj()); |
282 break; | 279 break; |
283 default: | 280 default: |
284 NOTREACHED() << "Unexpected notification " << type; | 281 NOTREACHED() << "Unexpected notification " << type; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (print_view_manager == NULL) | 411 if (print_view_manager == NULL) |
415 return false; | 412 return false; |
416 | 413 |
417 print_view_manager->PrintNow(); | 414 print_view_manager->PrintNow(); |
418 return true; | 415 return true; |
419 } | 416 } |
420 | 417 |
421 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { | 418 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { |
422 return RegisterNativesImpl(env); | 419 return RegisterNativesImpl(env); |
423 } | 420 } |
OLD | NEW |