Chromium Code Reviews| Index: chrome/common/extensions/app_launcher_info.h |
| diff --git a/chrome/common/extensions/app_launcher_info.h b/chrome/common/extensions/app_launcher_info.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..78366904ae26e9ac9ab90c9bb57adc2ed5bcf928 |
| --- /dev/null |
| +++ b/chrome/common/extensions/app_launcher_info.h |
| @@ -0,0 +1,76 @@ |
| +// 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_LAUNCHER_INFO_H_ |
| +#define CHROME_COMMON_EXTENSIONS_APP_LAUNCHER_INFO_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "chrome/common/extensions/extension.h" |
| +#include "chrome/common/extensions/extension_constants.h" |
| +#include "chrome/common/extensions/manifest.h" |
| +#include "chrome/common/extensions/manifest_handler.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace extensions { |
| + |
| +// Container that holds the parsed app launch data. |
| +class AppLauncherInfo : public Extension::ManifestData { |
| + public: |
| + AppLauncherInfo(); |
| + virtual ~AppLauncherInfo(); |
| + |
| + static const std::string& GetLaunchLocalPath(const Extension* extension); |
| + static const std::string& GetLaunchWebURL(const Extension* extension); |
| + 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, 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. |
| + 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_; |
| +}; |
|
Devlin
2013/03/08 17:44:21
DISALLOW_COPY_AND_ASSIGN
Joe Thomas
2013/03/09 01:59:52
Done.
|
| + |
| +// 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; |
| + |
| + private: |
| + virtual const std::vector<std::string> Keys() const OVERRIDE; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AppLaunchManifestHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_APP_LAUNCHER_INFO_H_ |