| 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> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 *target = 0; | 44 *target = 0; |
| 45 *error = ErrorUtils::FormatErrorMessageUTF16( | 45 *error = ErrorUtils::FormatErrorMessageUTF16( |
| 46 errors::kInvalidLaunchValue, | 46 errors::kInvalidLaunchValue, |
| 47 key); | 47 key); |
| 48 return false; | 48 return false; |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
| 53 | 53 |
| 54 static base::LazyInstance<AppLaunchInfo> g_empty_app_launch_info = | 54 static base::LazyInstance<AppLaunchInfo>::DestructorAtExit |
| 55 LAZY_INSTANCE_INITIALIZER; | 55 g_empty_app_launch_info = LAZY_INSTANCE_INITIALIZER; |
| 56 | 56 |
| 57 const AppLaunchInfo& GetAppLaunchInfo(const Extension* extension) { | 57 const AppLaunchInfo& GetAppLaunchInfo(const Extension* extension) { |
| 58 AppLaunchInfo* info = static_cast<AppLaunchInfo*>( | 58 AppLaunchInfo* info = static_cast<AppLaunchInfo*>( |
| 59 extension->GetManifestData(keys::kLaunch)); | 59 extension->GetManifestData(keys::kLaunch)); |
| 60 return info ? *info : g_empty_app_launch_info.Get(); | 60 return info ? *info : g_empty_app_launch_info.Get(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| 64 | 64 |
| 65 AppLaunchInfo::AppLaunchInfo() | 65 AppLaunchInfo::AppLaunchInfo() |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 keys::kLaunchLocalPath, | 318 keys::kLaunchLocalPath, |
| 319 keys::kLaunchWebURL, | 319 keys::kLaunchWebURL, |
| 320 keys::kLaunchContainer, | 320 keys::kLaunchContainer, |
| 321 keys::kLaunchHeight, | 321 keys::kLaunchHeight, |
| 322 keys::kLaunchWidth | 322 keys::kLaunchWidth |
| 323 }; | 323 }; |
| 324 return std::vector<std::string>(keys, keys + arraysize(keys)); | 324 return std::vector<std::string>(keys, keys + arraysize(keys)); |
| 325 } | 325 } |
| 326 | 326 |
| 327 } // namespace extensions | 327 } // namespace extensions |
| OLD | NEW |