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

Unified Diff: chrome/browser/extensions/extensions_startup.cc

Issue 10824204: Move small c/b/extensions classes into extensions namespace no.2 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
Index: chrome/browser/extensions/extensions_startup.cc
diff --git a/chrome/browser/extensions/extensions_startup.cc b/chrome/browser/extensions/extensions_startup.cc
deleted file mode 100644
index cd11840f73b394350878e2a49af308d0bb04ba44..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/extensions_startup.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/extensions/extensions_startup.h"
-
-#include "base/string_util.h"
-#include "base/stringprintf.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/simple_message_box.h"
-#include "chrome/common/chrome_switches.h"
-
-ExtensionsStartupUtil::ExtensionsStartupUtil() : pack_job_succeeded_(false) {}
-
-void ExtensionsStartupUtil::OnPackSuccess(
- const FilePath& crx_path,
- const FilePath& output_private_key_path) {
- pack_job_succeeded_ = true;
- chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Success"),
- PackExtensionJob::StandardSuccessMessage(crx_path,
- output_private_key_path),
- chrome::MESSAGE_BOX_TYPE_INFORMATION);
-}
-
-void ExtensionsStartupUtil::OnPackFailure(
- const std::string& error_message,
- extensions::ExtensionCreator::ErrorType type) {
- chrome::ShowMessageBox(NULL, ASCIIToUTF16("Extension Packaging Error"),
- UTF8ToUTF16(error_message), chrome::MESSAGE_BOX_TYPE_WARNING);
-}
-
-bool ExtensionsStartupUtil::PackExtension(const CommandLine& cmd_line) {
- if (!cmd_line.HasSwitch(switches::kPackExtension))
- return false;
-
- // Input Paths.
- FilePath src_dir = cmd_line.GetSwitchValuePath(switches::kPackExtension);
- FilePath private_key_path;
- if (cmd_line.HasSwitch(switches::kPackExtensionKey)) {
- private_key_path = cmd_line.GetSwitchValuePath(switches::kPackExtensionKey);
- }
-
- // Launch a job to perform the packing on the file thread. Ignore warnings
- // from the packing process. (e.g. Overwrite any existing crx file.)
- pack_job_ = new PackExtensionJob(this, src_dir, private_key_path,
- extensions::ExtensionCreator::kOverwriteCRX);
- pack_job_->set_asynchronous(false);
- pack_job_->Start();
-
- return pack_job_succeeded_;
-}
-
-bool ExtensionsStartupUtil::UninstallExtension(const CommandLine& cmd_line,
- Profile* profile) {
- DCHECK(profile);
-
- if (!cmd_line.HasSwitch(switches::kUninstallExtension))
- return false;
-
- ExtensionService* extension_service = profile->GetExtensionService();
- if (!extension_service)
- return false;
-
- std::string extension_id = cmd_line.GetSwitchValueASCII(
- switches::kUninstallExtension);
- return ExtensionService::UninstallExtensionHelper(extension_service,
- extension_id);
-}
-
-ExtensionsStartupUtil::~ExtensionsStartupUtil() {
- if (pack_job_.get())
- pack_job_->ClearClient();
-}

Powered by Google App Engine
This is Rietveld 408576698