| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/common/extensions/manifest_handlers/app_launch_info.h" | 5 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
| 6 | 6 |
| 7 #include <memory> |
| 8 |
| 7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 9 #include "base/macros.h" | 11 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/values.h" | 13 #include "base/values.h" |
| 13 #include "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
| 15 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| 16 #include "components/cloud_devices/common/cloud_devices_urls.h" | 17 #include "components/cloud_devices/common/cloud_devices_urls.h" |
| 17 #include "extensions/common/constants.h" | 18 #include "extensions/common/constants.h" |
| 18 #include "extensions/common/error_utils.h" | 19 #include "extensions/common/error_utils.h" |
| 19 #include "extensions/common/manifest_constants.h" | 20 #include "extensions/common/manifest_constants.h" |
| 20 | 21 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 295 } |
| 295 | 296 |
| 296 AppLaunchManifestHandler::AppLaunchManifestHandler() { | 297 AppLaunchManifestHandler::AppLaunchManifestHandler() { |
| 297 } | 298 } |
| 298 | 299 |
| 299 AppLaunchManifestHandler::~AppLaunchManifestHandler() { | 300 AppLaunchManifestHandler::~AppLaunchManifestHandler() { |
| 300 } | 301 } |
| 301 | 302 |
| 302 bool AppLaunchManifestHandler::Parse(Extension* extension, | 303 bool AppLaunchManifestHandler::Parse(Extension* extension, |
| 303 base::string16* error) { | 304 base::string16* error) { |
| 304 scoped_ptr<AppLaunchInfo> info(new AppLaunchInfo); | 305 std::unique_ptr<AppLaunchInfo> info(new AppLaunchInfo); |
| 305 if (!info->Parse(extension, error)) | 306 if (!info->Parse(extension, error)) |
| 306 return false; | 307 return false; |
| 307 extension->SetManifestData(keys::kLaunch, info.release()); | 308 extension->SetManifestData(keys::kLaunch, info.release()); |
| 308 return true; | 309 return true; |
| 309 } | 310 } |
| 310 | 311 |
| 311 bool AppLaunchManifestHandler::AlwaysParseForType(Manifest::Type type) const { | 312 bool AppLaunchManifestHandler::AlwaysParseForType(Manifest::Type type) const { |
| 312 return type == Manifest::TYPE_LEGACY_PACKAGED_APP; | 313 return type == Manifest::TYPE_LEGACY_PACKAGED_APP; |
| 313 } | 314 } |
| 314 | 315 |
| 315 const std::vector<std::string> AppLaunchManifestHandler::Keys() const { | 316 const std::vector<std::string> AppLaunchManifestHandler::Keys() const { |
| 316 static const char* const keys[] = { | 317 static const char* const keys[] = { |
| 317 keys::kLaunchLocalPath, | 318 keys::kLaunchLocalPath, |
| 318 keys::kLaunchWebURL, | 319 keys::kLaunchWebURL, |
| 319 keys::kLaunchContainer, | 320 keys::kLaunchContainer, |
| 320 keys::kLaunchHeight, | 321 keys::kLaunchHeight, |
| 321 keys::kLaunchWidth | 322 keys::kLaunchWidth |
| 322 }; | 323 }; |
| 323 return std::vector<std::string>(keys, keys + arraysize(keys)); | 324 return std::vector<std::string>(keys, keys + arraysize(keys)); |
| 324 } | 325 } |
| 325 | 326 |
| 326 } // namespace extensions | 327 } // namespace extensions |
| OLD | NEW |