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

Side by Side Diff: chrome/browser/extensions/extension_util.cc

Issue 1414643005: Disable zoom bubble for PDF extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Need to check for valid client before early out. Created 5 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/extension_util.h" 5 #include "chrome/browser/extensions/extension_util.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 content::BrowserContext* context) { 191 content::BrowserContext* context) {
192 CHECK(extension); 192 CHECK(extension);
193 if (extension->is_hosted_app()) 193 if (extension->is_hosted_app())
194 return true; 194 return true;
195 // Packaged apps and regular extensions need to be enabled specifically for 195 // Packaged apps and regular extensions need to be enabled specifically for
196 // incognito (and split mode should be set). 196 // incognito (and split mode should be set).
197 return IncognitoInfo::IsSplitMode(extension) && 197 return IncognitoInfo::IsSplitMode(extension) &&
198 IsIncognitoEnabled(extension->id(), context); 198 IsIncognitoEnabled(extension->id(), context);
199 } 199 }
200 200
201 bool ZoomWithoutBubble(const Extension* extension) {
Ken Rockot(use gerrit already) 2015/10/21 16:53:30 nit: How about "CanZoomWithoutBubble" or "AllowZoo
wjmaclean 2015/10/21 16:59:46 Done. I like "AllowZoomWithoutBubble()" ... let's
202 return FeatureProvider::GetBehaviorFeature(
203 BehaviorFeature::kZoomWithoutBubble)
204 ->IsAvailableToExtension(extension)
205 .is_available();
206 }
207
201 bool AllowFileAccess(const std::string& extension_id, 208 bool AllowFileAccess(const std::string& extension_id,
202 content::BrowserContext* context) { 209 content::BrowserContext* context) {
203 return base::CommandLine::ForCurrentProcess()->HasSwitch( 210 return base::CommandLine::ForCurrentProcess()->HasSwitch(
204 switches::kDisableExtensionsFileAccessCheck) || 211 switches::kDisableExtensionsFileAccessCheck) ||
205 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); 212 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id);
206 } 213 }
207 214
208 void SetAllowFileAccess(const std::string& extension_id, 215 void SetAllowFileAccess(const std::string& extension_id,
209 content::BrowserContext* context, 216 content::BrowserContext* context,
210 bool allow) { 217 bool allow) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 } 383 }
377 384
378 bool NeedCustodianApprovalForPermissionIncrease() { 385 bool NeedCustodianApprovalForPermissionIncrease() {
379 const std::string group_name = base::FieldTrialList::FindFullName( 386 const std::string group_name = base::FieldTrialList::FindFullName(
380 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); 387 kSupervisedUserExtensionPermissionIncreaseFieldTrialName);
381 return group_name == "NeedCustodianApproval"; 388 return group_name == "NeedCustodianApproval";
382 } 389 }
383 390
384 } // namespace util 391 } // namespace util
385 } // namespace extensions 392 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698