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

Side by Side Diff: chrome/browser/automation/automation_provider.cc

Issue 1600030: Select and close previous theme info bars when resetting to default theme via... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/automation/automation_provider.h" 5 #include "chrome/browser/automation/automation_provider.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/message_box_flags.h" 10 #include "app/message_box_flags.h"
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 #endif 560 #endif
561 IPC_MESSAGE_HANDLER(AutomationMsg_RemoveBrowsingData, RemoveBrowsingData) 561 IPC_MESSAGE_HANDLER(AutomationMsg_RemoveBrowsingData, RemoveBrowsingData)
562 #if defined(TOOLKIT_VIEWS) 562 #if defined(TOOLKIT_VIEWS)
563 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForFocusedViewIDToChange, 563 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForFocusedViewIDToChange,
564 WaitForFocusedViewIDToChange) 564 WaitForFocusedViewIDToChange)
565 IPC_MESSAGE_HANDLER(AutomationMsg_StartTrackingPopupMenus, 565 IPC_MESSAGE_HANDLER(AutomationMsg_StartTrackingPopupMenus,
566 StartTrackingPopupMenus) 566 StartTrackingPopupMenus)
567 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen, 567 IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WaitForPopupMenuToOpen,
568 WaitForPopupMenuToOpen) 568 WaitForPopupMenuToOpen)
569 #endif 569 #endif
570 IPC_MESSAGE_HANDLER(AutomationMsg_ResetToDefaultTheme, ResetToDefaultTheme)
570 IPC_END_MESSAGE_MAP() 571 IPC_END_MESSAGE_MAP()
571 } 572 }
572 573
573 void AutomationProvider::ActivateTab(int handle, int at_index, int* status) { 574 void AutomationProvider::ActivateTab(int handle, int at_index, int* status) {
574 *status = -1; 575 *status = -1;
575 if (browser_tracker_->ContainsHandle(handle) && at_index > -1) { 576 if (browser_tracker_->ContainsHandle(handle) && at_index > -1) {
576 Browser* browser = browser_tracker_->GetResource(handle); 577 Browser* browser = browser_tracker_->GetResource(handle);
577 if (at_index >= 0 && at_index < browser->tab_count()) { 578 if (at_index >= 0 && at_index < browser->tab_count()) {
578 browser->SelectTabContentsAt(at_index, true); 579 browser->SelectTabContentsAt(at_index, true);
579 *status = 0; 580 *status = 0;
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
2786 void AutomationProvider::WaitForExtensionTestResult( 2787 void AutomationProvider::WaitForExtensionTestResult(
2787 IPC::Message* reply_message) { 2788 IPC::Message* reply_message) {
2788 DCHECK(reply_message_ == NULL); 2789 DCHECK(reply_message_ == NULL);
2789 reply_message_ = reply_message; 2790 reply_message_ = reply_message;
2790 // Call MaybeSendResult, because the result might have come in before 2791 // Call MaybeSendResult, because the result might have come in before
2791 // we were waiting on it. 2792 // we were waiting on it.
2792 extension_test_result_observer_->MaybeSendResult(); 2793 extension_test_result_observer_->MaybeSendResult();
2793 } 2794 }
2794 2795
2795 void AutomationProvider::InstallExtensionAndGetHandle( 2796 void AutomationProvider::InstallExtensionAndGetHandle(
2796 const FilePath& crx_path, IPC::Message* reply_message) { 2797 const FilePath& crx_path, bool with_ui, IPC::Message* reply_message) {
2797 ExtensionsService* service = profile_->GetExtensionsService(); 2798 ExtensionsService* service = profile_->GetExtensionsService();
2798 ExtensionProcessManager* manager = profile_->GetExtensionProcessManager(); 2799 ExtensionProcessManager* manager = profile_->GetExtensionProcessManager();
2799 if (service && manager) { 2800 if (service && manager) {
2800 // The observer will delete itself when done. 2801 // The observer will delete itself when done.
2801 new ExtensionReadyNotificationObserver( 2802 new ExtensionReadyNotificationObserver(
2802 manager, 2803 manager,
2803 this, 2804 this,
2804 AutomationMsg_InstallExtensionAndGetHandle::ID, 2805 AutomationMsg_InstallExtensionAndGetHandle::ID,
2805 reply_message); 2806 reply_message);
2806 2807
2808 ExtensionInstallUI* client =
2809 (with_ui ? new ExtensionInstallUI(profile_) : NULL);
2807 scoped_refptr<CrxInstaller> installer( 2810 scoped_refptr<CrxInstaller> installer(
2808 new CrxInstaller(service->install_directory(), 2811 new CrxInstaller(service->install_directory(),
2809 service, 2812 service,
2810 NULL)); // silent install, no UI 2813 client));
2811 installer->set_allow_privilege_increase(true); 2814 installer->set_allow_privilege_increase(true);
2812 installer->InstallCrx(crx_path); 2815 installer->InstallCrx(crx_path);
2813 } else { 2816 } else {
2814 AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams( 2817 AutomationMsg_InstallExtensionAndGetHandle::WriteReplyParams(
2815 reply_message, 0); 2818 reply_message, 0);
2816 Send(reply_message); 2819 Send(reply_message);
2817 } 2820 }
2818 } 2821 }
2819 2822
2820 void AutomationProvider::UninstallExtension(int extension_handle, 2823 void AutomationProvider::UninstallExtension(int extension_handle,
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 3003
3001 void AutomationProvider::StartTrackingPopupMenus( 3004 void AutomationProvider::StartTrackingPopupMenus(
3002 int browser_handle, bool* success) { 3005 int browser_handle, bool* success) {
3003 NOTIMPLEMENTED(); 3006 NOTIMPLEMENTED();
3004 } 3007 }
3005 3008
3006 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) { 3009 void AutomationProvider::WaitForPopupMenuToOpen(IPC::Message* reply_message) {
3007 NOTIMPLEMENTED(); 3010 NOTIMPLEMENTED();
3008 } 3011 }
3009 #endif // !defined(TOOLKIT_VIEWS) 3012 #endif // !defined(TOOLKIT_VIEWS)
3013
3014 void AutomationProvider::ResetToDefaultTheme() {
3015 profile_->ClearTheme();
3016 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider.h ('k') | chrome/browser/extensions/theme_installed_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698