| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_APP_LAUNCHER_INFO_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_APP_LAUNCHER_INFO_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "chrome/common/extensions/extension.h" |
| 12 #include "chrome/common/extensions/extension_constants.h" |
| 13 #include "chrome/common/extensions/manifest.h" |
| 14 #include "chrome/common/extensions/manifest_handler.h" |
| 15 #include "googleurl/src/gurl.h" |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 // Container that holds the parsed app launch data. |
| 20 class AppLauncherInfo : public Extension::ManifestData { |
| 21 public: |
| 22 AppLauncherInfo(); |
| 23 virtual ~AppLauncherInfo(); |
| 24 |
| 25 static const std::string& GetLaunchLocalPath(const Extension* extension); |
| 26 static const std::string& GetLaunchWebURL(const Extension* extension); |
| 27 static extension_misc::LaunchContainer GetLaunchContainer( |
| 28 const Extension* extension); |
| 29 static int GetLaunchWidth(const Extension* extension); |
| 30 static int GetLaunchHeight(const Extension* extension); |
| 31 static GURL GetFullLaunchURL(const Extension* extension); |
| 32 |
| 33 bool Parse(Extension* extension, string16* error); |
| 34 |
| 35 private: |
| 36 bool LoadLaunchURL(Extension* extension, string16* error); |
| 37 bool LoadLaunchContainer(Extension* extension, string16* error); |
| 38 void OverrideLaunchURL(Extension* extension, GURL override_url); |
| 39 |
| 40 // The local path inside the extension to use with the launcher. |
| 41 std::string launch_local_path_; |
| 42 |
| 43 // An absolute web url to use with the launcher. |
| 44 std::string launch_web_url_; |
| 45 |
| 46 // The window type that an app's manifest specifies to launch into. |
| 47 // This is not always the window type an app will open into, because |
| 48 // users can override the way each app launches. See |
| 49 // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref |
| 50 // to decide what container an app will launch in. |
| 51 extension_misc::LaunchContainer launch_container_; |
| 52 |
| 53 // The default size of the container when launching. Only respected for |
| 54 // containers like panels and windows. |
| 55 int launch_width_; |
| 56 int launch_height_; |
| 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(AppLauncherInfo); |
| 59 }; |
| 60 |
| 61 // Parses all app launch related keys in the manifest. |
| 62 class AppLaunchManifestHandler : public ManifestHandler { |
| 63 public: |
| 64 AppLaunchManifestHandler(); |
| 65 virtual ~AppLaunchManifestHandler(); |
| 66 |
| 67 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; |
| 68 virtual bool AlwaysParseForType(Manifest::Type type) const OVERRIDE; |
| 69 |
| 70 private: |
| 71 virtual const std::vector<std::string> Keys() const OVERRIDE; |
| 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(AppLaunchManifestHandler); |
| 74 }; |
| 75 |
| 76 } // namespace extensions |
| 77 |
| 78 #endif // CHROME_COMMON_EXTENSIONS_APP_LAUNCHER_INFO_H_ |
| OLD | NEW |