Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3219)

Unified Diff: chrome/common/extensions/extension.cc

Issue 9452008: Allow platform apps to specify a maximum size for the shell container. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing file Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 04eb7dff7d9a63295feafc8e0c9fbf0fd9ba60f0..dd9fb92af796571f03a610c92deeca2b656c0b02 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1250,6 +1250,18 @@ bool Extension::LoadLaunchContainer(string16* error) {
can_specify_size_range,
error))
return false;
+ if (!ReadLaunchDimension(manifest_,
+ keys::kLaunchMaxWidth,
+ &launch_max_width_,
+ can_specify_size_range,
+ error))
+ return false;
+ if (!ReadLaunchDimension(manifest_,
+ keys::kLaunchMaxHeight,
+ &launch_max_height_,
+ can_specify_size_range,
+ error))
+ return false;
if (launch_container() == extension_misc::LAUNCH_SHELL) {
if (!manifest_->Get(keys::kLaunchWidth, &temp)) {
@@ -1264,6 +1276,18 @@ bool Extension::LoadLaunchContainer(string16* error) {
keys::kLaunchHeight);
return false;
}
+ if (launch_max_width_ > 0 && launch_max_width_ < launch_min_width_) {
+ *error = ExtensionErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidLaunchValue,
+ keys::kLaunchMaxWidth);
+ return false;
+ }
+ if (launch_max_height_ > 0 && launch_max_height_ < launch_min_height_) {
+ *error = ExtensionErrorUtils::FormatErrorMessageUTF16(
+ errors::kInvalidLaunchValue,
+ keys::kLaunchMaxHeight);
+ return false;
+ }
}
return true;
@@ -1511,6 +1535,8 @@ Extension::Extension(const FilePath& path,
launch_height_(0),
launch_min_width_(0),
launch_min_height_(0),
+ launch_max_width_(0),
+ launch_max_height_(0),
wants_file_access_(false),
creation_flags_(0) {
DCHECK(path.empty() || path.IsAbsolute());
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698