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

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

Issue 143333008: [Android] Remove the "Always show" button for blocked popups if the setting is controlled by policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue340704a
Patch Set: x Created 6 years, 10 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/ui/android/content_settings/popup_blocked_infobar_delegate.h » ('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 (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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698