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

Side by Side Diff: extensions/browser/extension_zoom_request_client.cc

Issue 1835863002: Added check for behavior feature existense (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make Get*Feature return |nullptr| instead crash if feature is missing Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_zoom_request_client.h" 5 #include "extensions/browser/extension_zoom_request_client.h"
6 6
7 #include "extensions/common/features/behavior_feature.h" 7 #include "extensions/common/features/behavior_feature.h"
8 #include "extensions/common/features/feature.h"
8 #include "extensions/common/features/feature_provider.h" 9 #include "extensions/common/features/feature_provider.h"
9 10
10 namespace extensions { 11 namespace extensions {
11 12
12 ExtensionZoomRequestClient::ExtensionZoomRequestClient( 13 ExtensionZoomRequestClient::ExtensionZoomRequestClient(
13 scoped_refptr<const Extension> extension) 14 scoped_refptr<const Extension> extension)
14 : extension_(extension) { 15 : extension_(extension) {
15 } 16 }
16 17
17 bool ExtensionZoomRequestClient::ShouldSuppressBubble() const { 18 bool ExtensionZoomRequestClient::ShouldSuppressBubble() const {
18 return FeatureProvider::GetBehaviorFeature( 19 const Feature* feature =
19 BehaviorFeature::kZoomWithoutBubble) 20 FeatureProvider::GetBehaviorFeature(BehaviorFeature::kZoomWithoutBubble);
20 ->IsAvailableToExtension(extension()) 21 return feature && feature->IsAvailableToExtension(extension()).is_available();
21 .is_available();
22 } 22 }
23 23
24 ExtensionZoomRequestClient::~ExtensionZoomRequestClient() { 24 ExtensionZoomRequestClient::~ExtensionZoomRequestClient() {
25 } 25 }
26 26
27 } // namespace Extensions 27 } // namespace Extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/sync_helper.cc ('k') | extensions/browser/guest_view/extensions_guest_view_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698