summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 19:43:28 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-22 19:43:28 +0000
commit859ee01c710ce09d7adf900bfb7aa3353d2a65da (patch)
treef492014b36db63f706ae0941b3c576954f071aa7
parent126d578f219abcc2f7c4642d5cbe7bcb40049339 (diff)
downloadchromium_src-859ee01c710ce09d7adf900bfb7aa3353d2a65da.zip
chromium_src-859ee01c710ce09d7adf900bfb7aa3353d2a65da.tar.gz
chromium_src-859ee01c710ce09d7adf900bfb7aa3353d2a65da.tar.bz2
Revert 50489 - Added app.launch.width and app.launch.height keys to app manifest.
This allows panels and window container types to specify initial dimensions when launching. BUG=46501 TEST=add app.launch.width/height to an app manifest with container==panel/window Review URL: http://codereview.chromium.org/2814016 TBR=scherkus@chromium.org Review URL: http://codereview.chromium.org/2823023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50505 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc6
-rw-r--r--chrome/common/extensions/extension.cc30
-rw-r--r--chrome/common/extensions/extension.h7
-rw-r--r--chrome/common/extensions/extension_constants.cc10
-rw-r--r--chrome/common/extensions/extension_constants.h6
-rw-r--r--chrome/common/extensions/extension_manifests_unittest.cc14
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_height.json11
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_height_invalid.json11
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_height_negative.json11
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_width.json11
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_width_invalid.json12
-rw-r--r--chrome/test/data/extensions/manifest_tests/launch_width_negative.json11
12 files changed, 0 insertions, 140 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 0935c25..d3e481c 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -312,13 +312,7 @@ Browser* Browser::CreateForApp(const std::wstring& app_name,
Browser* browser = new Browser(type, profile);
browser->app_name_ = app_name;
browser->extension_app_ = extension;
-
- gfx::Rect initial_pos(extension->launch_width(), extension->launch_height());
- if (!initial_pos.IsEmpty())
- browser->set_override_bounds(initial_pos);
-
browser->CreateBrowserWindow();
-
return browser;
}
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 7118853..d2b3d3b 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -679,34 +679,6 @@ bool Extension::LoadLaunchContainer(const DictionaryValue* manifest,
return false;
}
- // Validate the container width if present.
- if (manifest->Get(keys::kLaunchWidth, &temp)) {
- if (launch_container_ != LAUNCH_PANEL &&
- launch_container_ != LAUNCH_WINDOW) {
- *error = errors::kInvalidLaunchWidthContainer;
- return false;
- }
- if (!temp->GetAsInteger(&launch_width_) || launch_width_ < 0) {
- launch_width_ = 0;
- *error = errors::kInvalidLaunchWidth;
- return false;
- }
- }
-
- // Validate container height if present.
- if (manifest->Get(keys::kLaunchHeight, &temp)) {
- if (launch_container_ != LAUNCH_PANEL &&
- launch_container_ != LAUNCH_WINDOW) {
- *error = errors::kInvalidLaunchHeightContainer;
- return false;
- }
- if (!temp->GetAsInteger(&launch_height_) || launch_height_ < 0) {
- launch_height_ = 0;
- *error = errors::kInvalidLaunchHeight;
- return false;
- }
- }
-
return true;
}
@@ -730,8 +702,6 @@ Extension::Extension(const FilePath& path)
is_app_(false),
launch_container_(LAUNCH_TAB),
launch_fullscreen_(false),
- launch_width_(0),
- launch_height_(0),
background_page_ready_(false),
being_upgraded_(false) {
DCHECK(path.IsAbsolute());
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index a6a5e78..107d014 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -335,8 +335,6 @@ class Extension {
const std::string& launch_web_url() const { return launch_web_url_; }
LaunchContainer launch_container() const { return launch_container_; }
bool launch_fullscreen() const { return launch_fullscreen_; }
- int launch_width() const { return launch_width_; }
- int launch_height() const { return launch_height_; }
// Gets the fully resolved absolute launch URL.
GURL GetFullLaunchURL() const;
@@ -522,11 +520,6 @@ class Extension {
// Launch full screen by default.
bool launch_fullscreen_;
- // The default size of the container when launching. Only respected for
- // containers like panels and windows.
- int launch_width_;
- int launch_height_;
-
// Cached images for this extension. This maps from the relative_path of the
// resource to the cached image.
ImageCache image_cache_;
diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc
index b854dfb..be58611 100644
--- a/chrome/common/extensions/extension_constants.cc
+++ b/chrome/common/extensions/extension_constants.cc
@@ -22,10 +22,8 @@ const wchar_t* kJs = L"js";
const wchar_t* kLaunch = L"app.launch";
const wchar_t* kLaunchContainer = L"app.launch.container";
const wchar_t* kLaunchFullscreen = L"app.launch.fullscreen";
-const wchar_t* kLaunchHeight = L"app.launch.height";
const wchar_t* kLaunchLocalPath = L"app.launch.local_path";
const wchar_t* kLaunchWebURL = L"app.launch.web_url";
-const wchar_t* kLaunchWidth = L"app.launch.width";
const wchar_t* kMatches = L"matches";
const wchar_t* kMinimumChromeVersion = L"minimum_chrome_version";
const wchar_t* kIncludeGlobs = L"include_globs";
@@ -118,18 +116,10 @@ const char* kInvalidLaunchContainer =
"Invalid value for 'app.launch.container'.";
const char* kInvalidLaunchFullscreen =
"Invalid value for 'app.launch.fullscreen'.";
-const char* kInvalidLaunchHeight =
- "Invalid value for 'app.launch.height'.";
-const char* kInvalidLaunchHeightContainer =
- "Invalid container type for 'app.launch.height'.";
const char* kInvalidLaunchLocalPath =
"Invalid value for 'app.launch.local_path'.";
const char* kInvalidLaunchWebURL =
"Invalid value for 'app.launch.web_url'.";
-const char* kInvalidLaunchWidth =
- "Invalid value for 'app.launch.width'.";
-const char* kInvalidLaunchWidthContainer =
- "Invalid container type for 'app.launch.width'.";
const char* kInvalidKey =
"Value 'key' is missing or invalid.";
const char* kInvalidManifest =
diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h
index 510ccd7..c515c72 100644
--- a/chrome/common/extensions/extension_constants.h
+++ b/chrome/common/extensions/extension_constants.h
@@ -25,9 +25,7 @@ namespace extension_manifest_keys {
extern const wchar_t* kLaunch;
extern const wchar_t* kLaunchContainer;
extern const wchar_t* kLaunchFullscreen;
- extern const wchar_t* kLaunchHeight;
extern const wchar_t* kLaunchLocalPath;
- extern const wchar_t* kLaunchWidth;
extern const wchar_t* kLaunchWebURL;
extern const wchar_t* kJs;
extern const wchar_t* kMatches;
@@ -103,12 +101,8 @@ namespace extension_manifest_errors {
extern const char* kInvalidKey;
extern const char* kInvalidLaunchContainer;
extern const char* kInvalidLaunchFullscreen;
- extern const char* kInvalidLaunchHeight;
- extern const char* kInvalidLaunchHeightContainer;
extern const char* kInvalidLaunchLocalPath;
extern const char* kInvalidLaunchWebURL;
- extern const char* kInvalidLaunchWidth;
- extern const char* kInvalidLaunchWidthContainer;
extern const char* kInvalidManifest;
extern const char* kInvalidMatchCount;
extern const char* kInvalidMatch;
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index 21f38537..cc0047e 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -136,12 +136,6 @@ TEST_F(ManifestTest, AppLaunchContainer) {
extension.reset(LoadAndExpectSuccess("launch_fullscreen.json"));
EXPECT_EQ(true, extension->launch_fullscreen());
- extension.reset(LoadAndExpectSuccess("launch_width.json"));
- EXPECT_EQ(640, extension->launch_width());
-
- extension.reset(LoadAndExpectSuccess("launch_height.json"));
- EXPECT_EQ(480, extension->launch_height());
-
LoadAndExpectError("launch_container_invalid_type.json",
errors::kInvalidLaunchContainer);
LoadAndExpectError("launch_container_invalid_value.json",
@@ -150,14 +144,6 @@ TEST_F(ManifestTest, AppLaunchContainer) {
errors::kLaunchURLRequired);
LoadAndExpectError("launch_fullscreen_invalid.json",
errors::kInvalidLaunchFullscreen);
- LoadAndExpectError("launch_width_invalid.json",
- errors::kInvalidLaunchWidthContainer);
- LoadAndExpectError("launch_width_negative.json",
- errors::kInvalidLaunchWidth);
- LoadAndExpectError("launch_height_invalid.json",
- errors::kInvalidLaunchHeightContainer);
- LoadAndExpectError("launch_height_negative.json",
- errors::kInvalidLaunchHeight);
}
TEST_F(ManifestTest, AppLaunchURL) {
diff --git a/chrome/test/data/extensions/manifest_tests/launch_height.json b/chrome/test/data/extensions/manifest_tests/launch_height.json
deleted file mode 100644
index dfcb067..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_height.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "window",
- "height": 480,
- "local_path": "bar.html"
- }
- }
-}
diff --git a/chrome/test/data/extensions/manifest_tests/launch_height_invalid.json b/chrome/test/data/extensions/manifest_tests/launch_height_invalid.json
deleted file mode 100644
index 22edc773..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_height_invalid.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "tab",
- "height": 480,
- "local_path": "bar.html"
- }
- }
-}
diff --git a/chrome/test/data/extensions/manifest_tests/launch_height_negative.json b/chrome/test/data/extensions/manifest_tests/launch_height_negative.json
deleted file mode 100644
index ed70e19..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_height_negative.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "window",
- "height": -1,
- "local_path": "bar.html"
- }
- }
-}
diff --git a/chrome/test/data/extensions/manifest_tests/launch_width.json b/chrome/test/data/extensions/manifest_tests/launch_width.json
deleted file mode 100644
index 994d162..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_width.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "window",
- "width": 640,
- "local_path": "bar.html"
- }
- }
-}
diff --git a/chrome/test/data/extensions/manifest_tests/launch_width_invalid.json b/chrome/test/data/extensions/manifest_tests/launch_width_invalid.json
deleted file mode 100644
index b886de4..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_width_invalid.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "tab",
- "width": 640,
- "local_path": "bar.html"
- }
- }
-}
-
diff --git a/chrome/test/data/extensions/manifest_tests/launch_width_negative.json b/chrome/test/data/extensions/manifest_tests/launch_width_negative.json
deleted file mode 100644
index e606871..0000000
--- a/chrome/test/data/extensions/manifest_tests/launch_width_negative.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "name": "test",
- "version": "1",
- "app": {
- "launch": {
- "container": "window",
- "width": -1,
- "local_path": "bar.html"
- }
- }
-}