Chromium Code Reviews| 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" | |
| 14 #include "chrome/browser/ui/extensions/application_launch.h" | 15 #include "chrome/browser/ui/extensions/application_launch.h" |
| 15 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 16 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 16 #include "extensions/browser/extension_registry.h" | 17 #include "extensions/browser/extension_registry.h" |
| 17 #include "extensions/browser/extension_system.h" | 18 #include "extensions/browser/extension_system.h" |
| 18 #include "extensions/common/constants.h" | 19 #include "extensions/common/constants.h" |
| 19 #include "extensions/common/extension_set.h" | 20 #include "extensions/common/extension_set.h" |
| 20 #include "extensions/common/extension_urls.h" | 21 #include "extensions/common/extension_urls.h" |
| 21 #include "net/base/url_util.h" | 22 #include "net/base/url_util.h" |
| 22 | 23 |
| 23 namespace athena { | 24 namespace athena { |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 51 app_id, extensions::ExtensionRegistry::EVERYTHING); | 52 app_id, extensions::ExtensionRegistry::EVERYTHING); |
| 52 DCHECK(extension); | 53 DCHECK(extension); |
| 53 if (!extension) | 54 if (!extension) |
| 54 return false; | 55 return false; |
| 55 | 56 |
| 56 // TODO(oshima): Support installation/enabling process. | 57 // TODO(oshima): Support installation/enabling process. |
| 57 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, context)) | 58 if (!extensions::util::IsAppLaunchableWithoutEnabling(app_id, context)) |
| 58 return false; | 59 return false; |
| 59 | 60 |
| 60 int event_flags = 0; | 61 int event_flags = 0; |
| 61 AppLaunchParams params(Profile::FromBrowserContext(context), | 62 AppLaunchParams params(Profile::FromBrowserContext(context), extension, |
| 62 extension, | 63 event_flags, chrome::HOST_DESKTOP_TYPE_ASH, |
| 63 event_flags, | 64 SOURCE_APP_LAUNCHER); |
|
oshima
2014/11/12 18:06:26
nit: one parameter per line.
cylee1
2014/11/12 20:02:07
Tried, but after running "git cl format" and it re
| |
| 64 chrome::HOST_DESKTOP_TYPE_ASH); | |
| 65 // TODO(oshima): rename HOST_DESTOP_TYPE_ASH to non native desktop. | 65 // TODO(oshima): rename HOST_DESTOP_TYPE_ASH to non native desktop. |
| 66 | 66 |
| 67 if (app_id == extensions::kWebStoreAppId) { | 67 if (app_id == extensions::kWebStoreAppId) { |
| 68 std::string source_value = | 68 std::string source_value = |
| 69 std::string(extension_urls::kLaunchSourceAppList); | 69 std::string(extension_urls::kLaunchSourceAppList); |
| 70 // Set an override URL to include the source. | 70 // Set an override URL to include the source. |
| 71 GURL extension_url = | 71 GURL extension_url = |
| 72 extensions::AppLaunchInfo::GetFullLaunchURL(extension); | 72 extensions::AppLaunchInfo::GetFullLaunchURL(extension); |
| 73 params.override_url = net::AppendQueryParameter( | 73 params.override_url = net::AppendQueryParameter( |
| 74 extension_url, extension_urls::kWebstoreSourceField, source_value); | 74 extension_url, extension_urls::kWebstoreSourceField, source_value); |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 103 | 103 |
| 104 } // namespace | 104 } // namespace |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 void ExtensionsDelegate::CreateExtensionsDelegate( | 107 void ExtensionsDelegate::CreateExtensionsDelegate( |
| 108 content::BrowserContext* context) { | 108 content::BrowserContext* context) { |
| 109 new ChromeExtensionsDelegate(context); | 109 new ChromeExtensionsDelegate(context); |
| 110 } | 110 } |
| 111 | 111 |
| 112 } // namespace athena | 112 } // namespace athena |
| OLD | NEW |