diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 08:24:59 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 08:24:59 +0000 |
commit | f36ed64560f4b52724d223bc870addc5a5e3b73c (patch) | |
tree | a57f393275bf6b24bb8b3d31d93a587544cd0cb9 | |
parent | 7e5d1e689c3c5a8858a9675df46ca327f51b7c6e (diff) | |
download | chromium_src-f36ed64560f4b52724d223bc870addc5a5e3b73c.zip chromium_src-f36ed64560f4b52724d223bc870addc5a5e3b73c.tar.gz chromium_src-f36ed64560f4b52724d223bc870addc5a5e3b73c.tar.bz2 |
Revert 36337 and 36338. Compile failure.
TBR=erikkay@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36339 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/crx_installer.cc | 25 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_tabs_module.cc | 10 | ||||
-rw-r--r-- | chrome/browser/utility_process_host.cc | 3 | ||||
-rwxr-xr-x | chrome/chrome_tests.gypi | 2 | ||||
-rwxr-xr-x | chrome/common/extensions/api/extension_api.json | 3 | ||||
-rw-r--r-- | chrome/common/extensions/extension.cc | 18 | ||||
-rw-r--r-- | chrome/common/extensions/extension.h | 8 | ||||
-rw-r--r-- | chrome/common/extensions/extension_constants.cc | 5 | ||||
-rw-r--r-- | chrome/common/extensions/extension_constants.h | 2 | ||||
-rw-r--r-- | chrome/test/data/extensions/api_test/tabs/basics/test.js | 9 |
10 files changed, 10 insertions, 75 deletions
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index defeff4..ca01297 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -5,7 +5,6 @@ #include "chrome/browser/extensions/crx_installer.h" #include "app/l10n_util.h" -#include "app/resource_bundle.h" #include "base/file_util.h" #include "base/scoped_temp_dir.h" #include "base/string_util.h" @@ -14,12 +13,9 @@ #include "chrome/browser/chrome_thread.h" #include "chrome/browser/extensions/convert_user_script.h" #include "chrome/browser/extensions/extension_file_util.h" -#include "chrome/browser/shell_integration.h" -#include "chrome/browser/web_applications/web_app.h" #include "chrome/common/extensions/extension_error_reporter.h" #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" -#include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -157,11 +153,10 @@ void CrxInstaller::OnUnpackSuccess(const FilePath& temp_dir, return; } - if (client_.get() || extension_->IsApp()) { + if (client_.get()) { Extension::DecodeIcon(extension_.get(), Extension::EXTENSION_ICON_LARGE, &install_icon_); } - ChromeThread::PostTask( ChromeThread::UI, FROM_HERE, NewRunnableMethod(this, &CrxInstaller::ConfirmInstall)); @@ -237,24 +232,6 @@ void CrxInstaller::CompleteInstall() { return; } - if (extension_->IsApp()) { - SkBitmap icon = install_icon_.get() ? *install_icon_ : - *ResourceBundle::GetSharedInstance().GetBitmapNamed( - IDR_EXTENSION_DEFAULT_ICON); - - ShellIntegration::ShortcutInfo shortcut_info; - shortcut_info.url = extension_->app_launch_url(); - shortcut_info.title = UTF8ToUTF16(extension_->name()); - shortcut_info.description = UTF8ToUTF16(extension_->description()); - shortcut_info.favicon = icon; - shortcut_info.create_on_desktop = true; - - // TODO(aa): Seems nasty to be reusing the old webapps code this way. What - // baggage am I inheriting? - web_app::CreateShortcut(frontend_->profile()->GetPath(), shortcut_info, - NULL); - } - // This is lame, but we must reload the extension because absolute paths // inside the content scripts are established inside InitFromValue() and we // just moved the extension. diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc index 6f40ad6..19d2687 100644 --- a/chrome/browser/extensions/extension_tabs_module.cc +++ b/chrome/browser/extensions/extension_tabs_module.cc @@ -386,15 +386,7 @@ bool UpdateWindowFunction::RunImpl() { } browser->window()->SetBounds(bounds); - - if (update_props->HasKey(keys::kFocusedKey)) { - bool focused = false; - EXTENSION_FUNCTION_VALIDATE(update_props->GetBoolean(keys::kFocusedKey, - &focused)); - if (focused) - browser->window()->Activate(); - } - + // TODO(rafaelw): Support |focused|. result_.reset(ExtensionTabUtil::CreateWindowValue(browser, false)); return true; diff --git a/chrome/browser/utility_process_host.cc b/chrome/browser/utility_process_host.cc index 29ed98f..ccef437 100644 --- a/chrome/browser/utility_process_host.cc +++ b/chrome/browser/utility_process_host.cc @@ -83,9 +83,6 @@ bool UtilityProcessHost::StartProcess(const FilePath& exposed_dir) { if (browser_command_line.HasSwitch(switches::kChromeFrame)) cmd_line->AppendSwitch(switches::kChromeFrame); - if (browser_command_line.HasSwitch(switches::kEnableExtensionApps)) - cmd_line->AppendSwitch(switches::kEnableExtensionApps); - #if defined(OS_POSIX) // TODO(port): Sandbox this on Linux. Also, zygote this to work with // Linux updating. diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 026584f..e82d3c9 100755 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -15,6 +15,7 @@ 'browser/extensions/extension_shelf_model_unittest.cc', 'browser/extensions/extension_startup_unittest.cc', 'browser/extensions/extension_storage_apitest.cc', + 'browser/extensions/extension_tabs_apitest.cc', 'browser/extensions/extension_popup_apitest.cc', # TODO(jam): http://crbug.com/15101 These tests fail on Linux and Mac. 'browser/child_process_security_policy_browser_test.cc', @@ -1114,7 +1115,6 @@ 'browser/extensions/extension_javascript_url_apitest.cc', 'browser/extensions/extension_messages_apitest.cc', 'browser/extensions/extension_override_apitest.cc', - 'browser/extensions/extension_tabs_apitest.cc', 'browser/extensions/extension_toolstrip_apitest.cc', 'browser/extensions/incognito_noscript_apitest.cc', 'browser/extensions/isolated_world_apitest.cc', diff --git a/chrome/common/extensions/api/extension_api.json b/chrome/common/extensions/api/extension_api.json index a02895f..1daeb09 100755 --- a/chrome/common/extensions/api/extension_api.json +++ b/chrome/common/extensions/api/extension_api.json @@ -357,8 +357,7 @@ "left": {"type": "integer", "optional": true, "description": "The offset from the left edge of the screen to move the window to in pixels."}, "top": {"type": "integer", "optional": true, "description": "The offset from the top edge of the screen to move the window to in pixels."}, "width": {"type": "integer", "minimum": 0, "optional": true, "description": "The width to resize the window to in pixels."}, - "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height to resize the window to in pixels."}, - "focused": {"type": "boolean", "optional": true, "description": "Set to true to focus the window. Setting to false has no effect on the window (it doesn't blur it)."} + "height": {"type": "integer", "minimum": 0, "optional": true, "description": "The height to resize the window to in pixels."} } }, { diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 6a6490f..2a0f139 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -506,24 +506,10 @@ bool Extension::LoadAppHelper(const DictionaryValue* app, std::string* error) { return false; } - // launch URL - std::string launch_url_spec; - if (!app->GetString(keys::kAppLaunchUrl, &launch_url_spec)) { - *error = errors::kInvalidAppLaunchUrl; - return false; - } - app_launch_url_ = GURL(launch_url_spec); - if (!app_launch_url_.is_valid()) { - *error = errors::kInvalidAppLaunchUrl; - return false; - } - // The launch URL is automatically an allowed origin. - app_origins_.push_back(url.GetOrigin()); - - // origins ListValue* origins; if (!app->GetList(keys::kAppOrigins, &origins) || origins->GetSize() == 0) { - *error = errors::kInvalidAppOrigin; + *error = + ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidAppOrigin, ""); return false; } for (ListValue::const_iterator iter = origins->begin(); diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h index 03eaee3..5ed2f7f 100644 --- a/chrome/common/extensions/extension.h +++ b/chrome/common/extensions/extension.h @@ -286,10 +286,9 @@ class Extension { bool GetBackgroundPageReady(); void SetBackgroundPageReady(); - // App stuff. + // The origins that this app is registered to. const std::vector<GURL>& app_origins() const { return app_origins_; } - const GURL& app_launch_url() const { return app_launch_url_; } - bool IsApp() const { return !app_launch_url_.is_empty(); } + bool IsApp() const { return !app_origins_.empty(); } private: // Helper method that loads a UserScript object from a @@ -423,9 +422,6 @@ class Extension { // The vector of origin URLs associated with an app. std::vector<GURL> app_origins_; - // The URL an app should launch to. - GURL app_launch_url_; - // Runtime data: diff --git a/chrome/common/extensions/extension_constants.cc b/chrome/common/extensions/extension_constants.cc index 817b54f..f756e13 100644 --- a/chrome/common/extensions/extension_constants.cc +++ b/chrome/common/extensions/extension_constants.cc @@ -9,7 +9,6 @@ namespace extension_manifest_keys { const wchar_t* kAllFrames = L"all_frames"; const wchar_t* kApp = L"app"; const wchar_t* kAppOrigins = L"origins"; -const wchar_t* kAppLaunchUrl = L"launch.url"; const wchar_t* kBackground = L"background_page"; const wchar_t* kBrowserAction = L"browser_action"; const wchar_t* kChromeURLOverrides = L"chrome_url_overrides"; @@ -76,9 +75,7 @@ const char* kChromeVersionTooLow = const char* kInvalidAllFrames = "Invalid value for 'content_scripts[*].all_frames'."; const char* kInvalidApp = "Invalid app."; -const char* kInvalidAppOrigin = "Invalid app origin[*]."; -const char* kInvalidAppLaunchUrl = - "Required value 'app.launch.url' is missing or invalid."; +const char* kInvalidAppOrigin = "Invalid app origin[*]"; const char* kInvalidBrowserAction = "Invalid value for 'browser_action'."; const char* kInvalidChromeURLOverrides = diff --git a/chrome/common/extensions/extension_constants.h b/chrome/common/extensions/extension_constants.h index 430070e..b7d945e 100644 --- a/chrome/common/extensions/extension_constants.h +++ b/chrome/common/extensions/extension_constants.h @@ -10,7 +10,6 @@ namespace extension_manifest_keys { extern const wchar_t* kAllFrames; extern const wchar_t* kApp; extern const wchar_t* kAppOrigins; - extern const wchar_t* kAppLaunchUrl; extern const wchar_t* kBackground; extern const wchar_t* kBrowserAction; extern const wchar_t* kMinimumChromeVersion; @@ -74,7 +73,6 @@ namespace extension_manifest_errors { extern const char* kInvalidAllFrames; extern const char* kInvalidApp; extern const char* kInvalidAppOrigin; - extern const char* kInvalidAppLaunchUrl; extern const char* kInvalidBackground; extern const char* kInvalidBrowserAction; extern const char* kInvalidChromeURLOverrides; diff --git a/chrome/test/data/extensions/api_test/tabs/basics/test.js b/chrome/test/data/extensions/api_test/tabs/basics/test.js index 00f20dd..a516ddc 100644 --- a/chrome/test/data/extensions/api_test/tabs/basics/test.js +++ b/chrome/test/data/extensions/api_test/tabs/basics/test.js @@ -35,6 +35,7 @@ chrome.test.runTests([ assertTrue(tab.index > firstTabIndex); assertEq(firstWindowId, tab.windowId); assertEq(false, tab.selected); + assertEq("chrome://newtab/", tab.url); })); }, @@ -240,14 +241,6 @@ chrome.test.runTests([ })); }, - function focus() { - chrome.test.listenOnce(chrome.windows.onFocusChanged, function(winId) { - assertEq(firstWindowId, winId); - }); - - chrome.windows.update(firstWindowId, {focused: true}, pass()); - }, - /* // TODO(jcampan): http://crbug.com/30662 the detection language library // crashes on some sites and has been temporarily disabled. |