summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-18 05:38:54 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-18 05:38:54 +0000
commit140debc9ab97da79036d70db21859d771cecf134 (patch)
treebb5a7ab2e15869ee14cc4a9c77a2848fb089d325 /chrome/browser/automation
parentedc53eb89220666a85fac4fe4fee9f0de52bd4ab (diff)
downloadchromium_src-140debc9ab97da79036d70db21859d771cecf134.zip
chromium_src-140debc9ab97da79036d70db21859d771cecf134.tar.gz
chromium_src-140debc9ab97da79036d70db21859d771cecf134.tar.bz2
Select and close previous theme info bars when resetting to default theme via the options dialog. As a nice side effect if one tab is showing a theme info bar and the user switches to a different theme in another tab, this change closes the previous theme info bars as well.
BUG=35607 TEST=Install a theme, and with the theme info bar visible open Preferences dialog and click 'reset to default theme' and check the info bar. (full steps given in the above bug entry) Landing http://codereview.chromium.org/1622017/show for Satish. Review URL: http://codereview.chromium.org/1600030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44885 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc11
-rw-r--r--chrome/browser/automation/automation_provider.h4
2 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 023b337..ccba52b 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -567,6 +567,7 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen,
WaitForPopupMenuToOpen)
#endif
+ IPC_MESSAGE_HANDLER(AutomationMsg_ResetToDefaultTheme, ResetToDefaultTheme)
IPC_END_MESSAGE_MAP()
}
@@ -2793,7 +2794,7 @@ void AutomationProvider::WaitForExtensionTestResult(
}
void AutomationProvider::InstallExtensionAndGetHandle(
- const FilePath& crx_path, IPC::Message* reply_message) {
+ const FilePath& crx_path, bool with_ui, IPC::Message* reply_message) {
ExtensionsService* service = profile_->GetExtensionsService();
ExtensionProcessManager* manager = profile_->GetExtensionProcessManager();
if (service && manager) {
@@ -2804,10 +2805,12 @@ void AutomationProvider::InstallExtensionAndGetHandle(
AutomationMsg_InstallExtensionAndGetHandle::ID,
reply_message);
+ ExtensionInstallUI* client =
+ (with_ui ? new ExtensionInstallUI(profile_) : NULL);
scoped_refptr<CrxInstaller> installer(
new CrxInstaller(service->install_directory(),
service,
- NULL)); // silent install, no UI
+ client));
installer->set_allow_privilege_increase(true);
installer->InstallCrx(crx_path);
} else {
@@ -3007,3 +3010,7 @@ void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) {
NOTIMPLEMENTED();
}
#endif // !defined(TOOLKIT_VIEWS)
+
+void AutomationProvider::ResetToDefaultTheme() {
+ profile_->ClearTheme();
+}
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index 0c30ced..9db04eb 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -398,6 +398,7 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
void WaitForExtensionTestResult(IPC::Message* reply_message);
void InstallExtensionAndGetHandle(const FilePath& crx_path,
+ bool with_ui,
IPC::Message* reply_message);
void UninstallExtension(int extension_handle,
@@ -560,6 +561,9 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>,
bool value,
bool* success);
+ // Resets to the default theme.
+ void ResetToDefaultTheme();
+
// Gets the current used encoding name of the page in the specified tab.
void GetPageCurrentEncoding(int tab_handle, std::string* current_encoding);