Commit 47617129 authored by levin@chromium.org's avatar levin@chromium.org

Two fixes for the limited install from webstore flag.

1. Add the resource to chrome.exe so that omaha can use it for app commands.
2. Make extension install not prompt because the window launches behind the
current window (along with other problems) which results in a bad user experience.

Note that the only code path touched is strictly only hit by the limited install from
webstore code path.


TESTED=The unit test and tested the functionality using a test page which calls the app command.
BUG=233783

Review URL: https://chromiumcodereview.appspot.com/14381004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195393 0039d316-1c4b-4281-b951-d872f2087c98
parent b06b39cb
......@@ -52,5 +52,17 @@ IDR_MAINFRAME ICON "theme\chromium\chromium.ico"
// constants are used in Chrome code to identify it.
IDR_X_APP_LIST ICON "theme\\app_list.ico"
/////////////////////////////////////////////////////////////////////////////
//
// GOOGLEUPDATEAPPLICATIONCOMMANDS is a "well-known" marker resource defined
// by Omaha. Executables must both be signed by Google and contain the marker
// in order to expose application commands.
//
#define IDR_GOOGLE_UPDATE_APP_COMMANDS_MARKUP 1
IDR_GOOGLE_UPDATE_APP_COMMANDS_MARKUP GOOGLEUPDATEAPPLICATIONCOMMANDS { 1L }
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
......@@ -322,7 +322,7 @@ void StartupHelper::LimitedInstallFromWebstore(
}
AppInstallHelper* helper = new AppInstallHelper();
helper->BeginInstall(profile, id, true /*show_prompt*/,
helper->BeginInstall(profile, id, false /*show_prompt*/,
base::Bind(&DeleteHelperAndRunCallback,
helper, done_callback));
}
......
......@@ -354,8 +354,6 @@ IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedAccept) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
command_line->AppendSwitchASCII(
switches::kLimitedInstallFromWebstore, "2");
command_line->AppendSwitchASCII(
switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
helper.LimitedInstallFromWebstore(*command_line, browser()->profile(),
MessageLoop::QuitWhenIdleClosure());
MessageLoop::current()->Run();
......@@ -363,17 +361,3 @@ IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedAccept) {
EXPECT_TRUE(saw_install());
EXPECT_EQ(0, browser_open_count());
}
IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedCancel) {
CommandLine* command_line = CommandLine::ForCurrentProcess();
command_line->AppendSwitchASCII(
switches::kLimitedInstallFromWebstore, "2");
command_line->AppendSwitchASCII(
switches::kAppsGalleryInstallAutoConfirmForTests, "cancel");
extensions::StartupHelper helper;
helper.LimitedInstallFromWebstore(*command_line, browser()->profile(),
MessageLoop::QuitWhenIdleClosure());
MessageLoop::current()->Run();
EXPECT_FALSE(saw_install());
EXPECT_EQ(0, browser_open_count());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment