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

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: git add deps file 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 AllowZoomWithoutBubble(const Extension* extension) {
202 return FeatureProvider::GetBehaviorFeature(
203 BehaviorFeature::kZoomWithoutBubble)
204 ->IsAvailableToExtension(extension)
205 .is_available();
206 }
207
208 bool AllowFileAccess(const std::string& extension_id, 201 bool AllowFileAccess(const std::string& extension_id,
209 content::BrowserContext* context) { 202 content::BrowserContext* context) {
210 return base::CommandLine::ForCurrentProcess()->HasSwitch( 203 return base::CommandLine::ForCurrentProcess()->HasSwitch(
211 switches::kDisableExtensionsFileAccessCheck) || 204 switches::kDisableExtensionsFileAccessCheck) ||
212 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); 205 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id);
213 } 206 }
214 207
215 void SetAllowFileAccess(const std::string& extension_id, 208 void SetAllowFileAccess(const std::string& extension_id,
216 content::BrowserContext* context, 209 content::BrowserContext* context,
217 bool allow) { 210 bool allow) {
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 376 }
384 377
385 bool NeedCustodianApprovalForPermissionIncrease() { 378 bool NeedCustodianApprovalForPermissionIncrease() {
386 const std::string group_name = base::FieldTrialList::FindFullName( 379 const std::string group_name = base::FieldTrialList::FindFullName(
387 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); 380 kSupervisedUserExtensionPermissionIncreaseFieldTrialName);
388 return group_name == "NeedCustodianApproval"; 381 return group_name == "NeedCustodianApproval";
389 } 382 }
390 383
391 } // namespace util 384 } // namespace util
392 } // namespace extensions 385 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698