Chromium Code Reviews| Index: chrome/common/extensions/app_launch_manifest_handler.h |
| diff --git a/chrome/common/extensions/app_launch_manifest_handler.h b/chrome/common/extensions/app_launch_manifest_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6ecf9bdb12d8facb6c2c9775874a654576b1d460 |
| --- /dev/null |
| +++ b/chrome/common/extensions/app_launch_manifest_handler.h |
| @@ -0,0 +1,72 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_COMMON_EXTENSIONS_APP_LAUNCH_MANIFEST_HANDLER_H_ |
|
Yoyo Zhou
2013/02/27 02:43:33
I think I'm liking app_launcher_info.h for the nam
Joe Thomas
2013/03/01 23:26:57
Yes. That is a better name. Done.
|
| +#define CHROME_COMMON_EXTENSIONS_APP_LAUNCH_MANIFEST_HANDLER_H_ |
| + |
| +#include "chrome/common/extensions/extension.h" |
| +#include "chrome/common/extensions/manifest_handler.h" |
|
Devlin
2013/02/27 19:12:48
Include what you use: LaunchContainer, GURL.
Joe Thomas
2013/03/01 23:26:57
Done.
|
| + |
| +namespace extensions { |
| + |
| +// Container that holds the parsed app launch data. |
| +class AppLaunchInfo : public Extension::ManifestData { |
| + public: |
| + AppLaunchInfo(); |
| + virtual ~AppLaunchInfo(); |
| + |
| + static const std::string& GetLaunchLocalPath(const Extension* extension); |
| + static const std::string& GetLaunchWebUrl(const Extension* extension); |
|
Yoyo Zhou
2013/02/27 02:43:33
Please change the naming so that these all use "UR
Joe Thomas
2013/03/01 23:26:57
Done.
|
| + static extension_misc::LaunchContainer GetLaunchContainer( |
| + const Extension* extension); |
| + static int GetLaunchWidth(const Extension* extension); |
| + static int GetLaunchHeight(const Extension* extension); |
| + static GURL GetFullLaunchURL(const Extension* extension); |
| + |
| + bool Parse(Extension* extension, string16* error); |
| + |
| + private: |
| + bool LoadLaunchURL(Extension* extension, string16* error); |
| + bool LoadLaunchContainer(Extension* extension, string16* error); |
| + void OverrideLaunchUrl(Extension* extension, const GURL& override_url); |
| + |
| + // The local path inside the extension to use with the launcher. |
| + std::string launch_local_path_; |
| + |
| + // A web url to use with the launcher. Note that this might be relative or |
| + // absolute. If relative, it is relative to web_origin. |
|
Yoyo Zhou
2013/02/27 02:43:33
This comment may need updating. (Where is web_orig
Joe Thomas
2013/03/01 23:26:57
Done. Removed that part.
Yoyo Zhou
2013/03/05 20:17:10
According to the comment in the cc, anyway, it mus
Joe Thomas
2013/03/09 01:59:52
Done.
|
| + std::string launch_web_url_; |
| + |
| + // The window type that an app's manifest specifies to launch into. |
| + // This is not always the window type an app will open into, because |
| + // users can override the way each app launches. See |
| + // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref |
| + // to decide what container an app will launch in. |
| + extension_misc::LaunchContainer launch_container_; |
| + |
| + // The default size of the container when launching. Only respected for |
| + // containers like panels and windows. |
| + int launch_width_; |
| + int launch_height_; |
| +}; |
| + |
| +// Parses all app launch related keys in the manifest. |
| +class AppLaunchManifestHandler : public ManifestHandler { |
| + public: |
| + AppLaunchManifestHandler(); |
| + virtual ~AppLaunchManifestHandler(); |
| + |
| + virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| + virtual bool AlwaysParseForType(Manifest::Type type) OVERRIDE; |
| + |
| + // Returns the list of keys that this handler parses. |
| + static const std::vector<std::string> keys(); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(AppLaunchManifestHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_APP_LAUNCH_MANIFEST_HANDLER_H_ |