Chromium Code Reviews| 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_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.
| |
| 6 #define CHROME_COMMON_EXTENSIONS_APP_LAUNCH_MANIFEST_HANDLER_H_ | |
| 7 | |
| 8 #include "chrome/common/extensions/extension.h" | |
| 9 #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.
| |
| 10 | |
| 11 namespace extensions { | |
| 12 | |
| 13 // Container that holds the parsed app launch data. | |
| 14 class AppLaunchInfo : public Extension::ManifestData { | |
| 15 public: | |
| 16 AppLaunchInfo(); | |
| 17 virtual ~AppLaunchInfo(); | |
| 18 | |
| 19 static const std::string& GetLaunchLocalPath(const Extension* extension); | |
| 20 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.
| |
| 21 static extension_misc::LaunchContainer GetLaunchContainer( | |
| 22 const Extension* extension); | |
| 23 static int GetLaunchWidth(const Extension* extension); | |
| 24 static int GetLaunchHeight(const Extension* extension); | |
| 25 static GURL GetFullLaunchURL(const Extension* extension); | |
| 26 | |
| 27 bool Parse(Extension* extension, string16* error); | |
| 28 | |
| 29 private: | |
| 30 bool LoadLaunchURL(Extension* extension, string16* error); | |
| 31 bool LoadLaunchContainer(Extension* extension, string16* error); | |
| 32 void OverrideLaunchUrl(Extension* extension, const GURL& override_url); | |
| 33 | |
| 34 // The local path inside the extension to use with the launcher. | |
| 35 std::string launch_local_path_; | |
| 36 | |
| 37 // A web url to use with the launcher. Note that this might be relative or | |
| 38 // 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.
| |
| 39 std::string launch_web_url_; | |
| 40 | |
| 41 // The window type that an app's manifest specifies to launch into. | |
| 42 // This is not always the window type an app will open into, because | |
| 43 // users can override the way each app launches. See | |
| 44 // ExtensionPrefs::GetLaunchContainer(), which looks at a per-app pref | |
| 45 // to decide what container an app will launch in. | |
| 46 extension_misc::LaunchContainer launch_container_; | |
| 47 | |
| 48 // The default size of the container when launching. Only respected for | |
| 49 // containers like panels and windows. | |
| 50 int launch_width_; | |
| 51 int launch_height_; | |
| 52 }; | |
| 53 | |
| 54 // Parses all app launch related keys in the manifest. | |
| 55 class AppLaunchManifestHandler : public ManifestHandler { | |
| 56 public: | |
| 57 AppLaunchManifestHandler(); | |
| 58 virtual ~AppLaunchManifestHandler(); | |
| 59 | |
| 60 virtual bool Parse(Extension* extension, string16* error) OVERRIDE; | |
| 61 virtual bool AlwaysParseForType(Manifest::Type type) OVERRIDE; | |
| 62 | |
| 63 // Returns the list of keys that this handler parses. | |
| 64 static const std::vector<std::string> keys(); | |
| 65 | |
| 66 private: | |
| 67 DISALLOW_COPY_AND_ASSIGN(AppLaunchManifestHandler); | |
| 68 }; | |
| 69 | |
| 70 } // namespace extensions | |
| 71 | |
| 72 #endif // CHROME_COMMON_EXTENSIONS_APP_LAUNCH_MANIFEST_HANDLER_H_ | |
| OLD | NEW |