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

Side by Side Diff: chrome/browser/ui/extensions/application_launch.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
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/common/extensions/sync_helper.cc » ('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/ui/extensions/application_launch.h" 5 #include "chrome/browser/ui/extensions/application_launch.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "apps/launcher.h" 9 #include "apps/launcher.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 return NULL; 403 return NULL;
404 404
405 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete(); 405 extensions::TabHelper::FromWebContents(tab)->UpdateShortcutOnLoadComplete();
406 406
407 return tab; 407 return tab;
408 } 408 }
409 409
410 bool CanLaunchViaEvent(const extensions::Extension* extension) { 410 bool CanLaunchViaEvent(const extensions::Extension* extension) {
411 const extensions::Feature* feature = 411 const extensions::Feature* feature =
412 extensions::FeatureProvider::GetAPIFeature("app.runtime"); 412 extensions::FeatureProvider::GetAPIFeature("app.runtime");
413 return feature->IsAvailableToExtension(extension).is_available(); 413 return feature && feature->IsAvailableToExtension(extension).is_available();
414 } 414 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_util.cc ('k') | chrome/common/extensions/sync_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698