OLD | NEW |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 delete this; | 100 delete this; |
101 } | 101 } |
102 | 102 |
103 void ExtensionEnableFlowAborted(bool user_initiated) override { delete this; } | 103 void ExtensionEnableFlowAborted(bool user_initiated) override { delete this; } |
104 | 104 |
105 ExtensionService* service_; | 105 ExtensionService* service_; |
106 Profile* profile_; | 106 Profile* profile_; |
107 std::string extension_id_; | 107 std::string extension_id_; |
108 base::Callback<gfx::NativeWindow(void)> parent_window_getter_; | 108 base::Callback<gfx::NativeWindow(void)> parent_window_getter_; |
109 base::Closure callback_; | 109 base::Closure callback_; |
110 scoped_ptr<ExtensionEnableFlow> flow_; | 110 std::unique_ptr<ExtensionEnableFlow> flow_; |
111 | 111 |
112 DISALLOW_COPY_AND_ASSIGN(EnableViaDialogFlow); | 112 DISALLOW_COPY_AND_ASSIGN(EnableViaDialogFlow); |
113 }; | 113 }; |
114 | 114 |
115 const Extension* GetExtension(const AppLaunchParams& params) { | 115 const Extension* GetExtension(const AppLaunchParams& params) { |
116 if (params.extension_id.empty()) | 116 if (params.extension_id.empty()) |
117 return NULL; | 117 return NULL; |
118 ExtensionRegistry* registry = ExtensionRegistry::Get(params.profile); | 118 ExtensionRegistry* registry = ExtensionRegistry::Get(params.profile); |
119 return registry->GetExtensionById(params.extension_id, | 119 return registry->GetExtensionById(params.extension_id, |
120 ExtensionRegistry::ENABLED | | 120 ExtensionRegistry::ENABLED | |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->IsAvailableToExtension(extension).is_available(); |
414 } | 414 } |
OLD | NEW |