diff options
author | mad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 20:21:18 +0000 |
---|---|---|
committer | mad@google.com <mad@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-01 20:21:18 +0000 |
commit | 6aeac834d9b08d597aee48a01a1661b715aac354 (patch) | |
tree | 775d52f045e2ab088f17f75df348693583e34ac5 /chrome/browser/browser_init.cc | |
parent | 17cc052becd9580498aac921f01c6dcbc52cb7ff (diff) | |
download | chromium_src-6aeac834d9b08d597aee48a01a1661b715aac354.zip chromium_src-6aeac834d9b08d597aee48a01a1661b715aac354.tar.gz chromium_src-6aeac834d9b08d597aee48a01a1661b715aac354.tar.bz2 |
Adding a flag to silently uninstall extensions by command line.
Committing for SteveT from http://codereview.chromium.org/3451016/show
Copied CL description:
======================
BUG=22901
TEST=(a) Install an extension and get its <id>, then run 'chrome.exe --uninstall-extensions=<id>' and ensure that extension is uninstalled. (b) Start chrome.exe normally, then run 'chrome.exe --pack-extension=<some valid extension dir>'. Ensure that the extension pack occurs without opening a new browser window (see bug for details).
Adding a flag to silently uninstall extensions by command line. Move --pack-extensions functionality into new extensions_startup files and move the call to browser_main.
======================
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61224 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.cc')
-rw-r--r-- | chrome/browser/browser_init.cc | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index f7f01a4..3e7e440 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -909,54 +909,6 @@ void BrowserInit::LaunchWithProfile::CheckDefaultBrowser(Profile* profile) { ChromeThread::FILE, FROM_HERE, new CheckDefaultBrowserTask()); } -class PackExtensionLogger : public PackExtensionJob::Client { - public: - PackExtensionLogger() {} - virtual void OnPackSuccess(const FilePath& crx_path, - const FilePath& output_private_key_path); - virtual void OnPackFailure(const std::string& error_message); - - private: - void ShowPackExtensionMessage(const std::wstring& caption, - const std::wstring& message); - - DISALLOW_COPY_AND_ASSIGN(PackExtensionLogger); -}; - -void PackExtensionLogger::OnPackSuccess(const FilePath& crx_path, - const FilePath& output_private_key_path) -{ - ShowPackExtensionMessage(L"Extension Packaging Success", - PackExtensionJob::StandardSuccessMessage( - crx_path, output_private_key_path)); -} - -void PackExtensionLogger::OnPackFailure(const std::string& error_message) { - ShowPackExtensionMessage(L"Extension Packaging Error", - UTF8ToWide(error_message)); -} - -void PackExtensionLogger::ShowPackExtensionMessage(const std::wstring& caption, - const std::wstring& message) -{ -#if defined(OS_WIN) - win_util::MessageBox(NULL, message, caption, MB_OK | MB_SETFOREGROUND); -#else - // Just send caption & text to stdout on mac & linux. - std::string out_text = WideToASCII(caption); - out_text.append("\n\n"); - out_text.append(WideToASCII(message)); - out_text.append("\n"); - printf("%s", out_text.c_str()); -#endif - - // We got the notification and processed it; we don't expect any further tasks - // to be posted to the current thread, so we should stop blocking and exit. - // This call to |Quit()| matches the call to |Run()| in - // |ProcessCmdLineImpl()|. - MessageLoop::current()->Quit(); -} - bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, const FilePath& cur_dir, bool process_startup, @@ -992,34 +944,6 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, profile, static_cast<size_t>(expected_tab_count)); } - - if (command_line.HasSwitch(switches::kPackExtension)) { - // Input Paths. - FilePath src_dir = command_line.GetSwitchValuePath( - switches::kPackExtension); - FilePath private_key_path; - if (command_line.HasSwitch(switches::kPackExtensionKey)) { - private_key_path = command_line.GetSwitchValuePath( - switches::kPackExtensionKey); - } - - // Launch a job to perform the packing on the file thread. - PackExtensionLogger pack_client; - scoped_refptr<PackExtensionJob> pack_job = - new PackExtensionJob(&pack_client, src_dir, private_key_path); - pack_job->Start(); - - // The job will post a notification task to the current thread's message - // loop when it is finished. We manually run the loop here so that we - // block and catch the notification. Otherwise, the process would exit; - // in particular, this would mean that |pack_client| would be destroyed - // and we wouldn't be able to report success or failure back to the user. - // This call to |Run()| is matched by a call to |Quit()| in the - // |PackExtensionLogger|'s notification handling code. - MessageLoop::current()->Run(); - - return false; - } } bool silent_launch = false; |