OLD | NEW |
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 "athena/extensions/public/extensions_delegate.h" | 5 #include "athena/extensions/public/extensions_delegate.h" |
6 | 6 |
7 #include "athena/extensions/chrome/athena_chrome_app_window_client.h" | 7 #include "athena/extensions/chrome/athena_chrome_app_window_client.h" |
8 #include "athena/extensions/chrome/athena_extension_install_ui.h" | 8 #include "athena/extensions/chrome/athena_extension_install_ui.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/extensions/extension_util.h" | 12 #include "chrome/browser/extensions/extension_util.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/extensions/app_launch_params.h" | |
15 #include "chrome/browser/ui/extensions/application_launch.h" | 14 #include "chrome/browser/ui/extensions/application_launch.h" |
16 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 15 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
17 #include "extensions/browser/extension_registry.h" | 16 #include "extensions/browser/extension_registry.h" |
18 #include "extensions/browser/extension_system.h" | 17 #include "extensions/browser/extension_system.h" |
19 #include "extensions/common/constants.h" | 18 #include "extensions/common/constants.h" |
20 #include "extensions/common/extension_set.h" | 19 #include "extensions/common/extension_set.h" |
21 #include "extensions/common/extension_urls.h" | 20 #include "extensions/common/extension_urls.h" |
22 #include "net/base/url_util.h" | 21 #include "net/base/url_util.h" |
23 | 22 |
24 namespace athena { | 23 namespace athena { |
(...skipping 28 matching lines...) Expand all Loading... |
53 app_id, extensions::ExtensionRegistry::EVERYTHING); | 52 app_id, extensions::ExtensionRegistry::EVERYTHING); |
54 DCHECK(extension); | 53 DCHECK(extension); |
55 if (!extension) | 54 if (!extension) |
56 return false; | 55 return false; |
57 | 56 |
58 // TODO(oshima): Support installation/enabling process. | 57 // TODO(oshima): Support installation/enabling process. |
59 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, context)) | 58 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, context)) |
60 return false; | 59 return false; |
61 | 60 |
62 int event_flags = 0; | 61 int event_flags = 0; |
63 AppLaunchParams params(Profile::FromBrowserContext(context), extension, | 62 AppLaunchParams params(Profile::FromBrowserContext(context), |
64 event_flags, chrome::HOST_DESKTOP_TYPE_ASH, | 63 extension, |
65 extensions::SOURCE_APP_LAUNCHER); | 64 event_flags, |
| 65 chrome::HOST_DESKTOP_TYPE_ASH); |
66 // TODO(oshima): rename HOST_DESTOP_TYPE_ASH to non native desktop. | 66 // TODO(oshima): rename HOST_DESTOP_TYPE_ASH to non native desktop. |
67 | 67 |
68 if (app_id == extensions::kWebStoreAppId) { | 68 if (app_id == extensions::kWebStoreAppId) { |
69 std::string source_value = | 69 std::string source_value = |
70 std::string(extension_urls::kLaunchSourceAppList); | 70 std::string(extension_urls::kLaunchSourceAppList); |
71 // Set an override URL to include the source. | 71 // Set an override URL to include the source. |
72 GURL extension_url = | 72 GURL extension_url = |
73 extensions::AppLaunchInfo::GetFullLaunchURL(extension); | 73 extensions::AppLaunchInfo::GetFullLaunchURL(extension); |
74 params.override_url = net::AppendQueryParameter( | 74 params.override_url = net::AppendQueryParameter( |
75 extension_url, extension_urls::kWebstoreSourceField, source_value); | 75 extension_url, extension_urls::kWebstoreSourceField, source_value); |
(...skipping 28 matching lines...) Expand all Loading... |
104 | 104 |
105 } // namespace | 105 } // namespace |
106 | 106 |
107 // static | 107 // static |
108 void ExtensionsDelegate::CreateExtensionsDelegate( | 108 void ExtensionsDelegate::CreateExtensionsDelegate( |
109 content::BrowserContext* context) { | 109 content::BrowserContext* context) { |
110 new ChromeExtensionsDelegate(context); | 110 new ChromeExtensionsDelegate(context); |
111 } | 111 } |
112 | 112 |
113 } // namespace athena | 113 } // namespace athena |
OLD | NEW |