| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 #include "chrome/browser/notifications/balloon_collection.h" | 55 #include "chrome/browser/notifications/balloon_collection.h" |
| 56 #include "chrome/browser/notifications/notification.h" | 56 #include "chrome/browser/notifications/notification.h" |
| 57 #include "chrome/browser/notifications/notification_ui_manager.h" | 57 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 58 #include "chrome/browser/password_manager/password_store.h" | 58 #include "chrome/browser/password_manager/password_store.h" |
| 59 #include "chrome/browser/platform_util.h" | 59 #include "chrome/browser/platform_util.h" |
| 60 #include "chrome/browser/prefs/pref_service.h" | 60 #include "chrome/browser/prefs/pref_service.h" |
| 61 #include "chrome/browser/profiles/profile.h" | 61 #include "chrome/browser/profiles/profile.h" |
| 62 #include "chrome/browser/profiles/profile_manager.h" | 62 #include "chrome/browser/profiles/profile_manager.h" |
| 63 #include "chrome/browser/search_engines/template_url.h" | 63 #include "chrome/browser/search_engines/template_url.h" |
| 64 #include "chrome/browser/search_engines/template_url_model.h" | 64 #include "chrome/browser/search_engines/template_url_model.h" |
| 65 #include "chrome/browser/sessions/session_service_factory.h" |
| 65 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" | 66 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" |
| 66 #include "chrome/browser/tab_contents/link_infobar_delegate.h" | 67 #include "chrome/browser/tab_contents/link_infobar_delegate.h" |
| 67 #include "chrome/browser/themes/theme_service.h" | 68 #include "chrome/browser/themes/theme_service.h" |
| 68 #include "chrome/browser/themes/theme_service_factory.h" | 69 #include "chrome/browser/themes/theme_service_factory.h" |
| 69 #include "chrome/browser/translate/translate_infobar_delegate.h" | 70 #include "chrome/browser/translate/translate_infobar_delegate.h" |
| 70 #include "chrome/browser/translate/translate_tab_helper.h" | 71 #include "chrome/browser/translate/translate_tab_helper.h" |
| 71 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" | 72 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" |
| 72 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" | 73 #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h" |
| 73 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" | 74 #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" |
| 74 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 75 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| (...skipping 5399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5474 | 5475 |
| 5475 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) | 5476 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) |
| 5476 *current_encoding = nav->tab_contents()->encoding(); | 5477 *current_encoding = nav->tab_contents()->encoding(); |
| 5477 } | 5478 } |
| 5478 } | 5479 } |
| 5479 | 5480 |
| 5480 void TestingAutomationProvider::ShutdownSessionService(int handle, | 5481 void TestingAutomationProvider::ShutdownSessionService(int handle, |
| 5481 bool* result) { | 5482 bool* result) { |
| 5482 if (browser_tracker_->ContainsHandle(handle)) { | 5483 if (browser_tracker_->ContainsHandle(handle)) { |
| 5483 Browser* browser = browser_tracker_->GetResource(handle); | 5484 Browser* browser = browser_tracker_->GetResource(handle); |
| 5484 browser->profile()->ShutdownSessionService(); | 5485 SessionServiceFactory::ShutdownForProfile(browser->profile()); |
| 5485 *result = true; | 5486 *result = true; |
| 5486 } else { | 5487 } else { |
| 5487 *result = false; | 5488 *result = false; |
| 5488 } | 5489 } |
| 5489 } | 5490 } |
| 5490 | 5491 |
| 5491 void TestingAutomationProvider::SetContentSetting( | 5492 void TestingAutomationProvider::SetContentSetting( |
| 5492 int handle, | 5493 int handle, |
| 5493 const std::string& host, | 5494 const std::string& host, |
| 5494 ContentSettingsType content_type, | 5495 ContentSettingsType content_type, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5567 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5568 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5568 | 5569 |
| 5569 Send(reply_message_); | 5570 Send(reply_message_); |
| 5570 redirect_query_ = 0; | 5571 redirect_query_ = 0; |
| 5571 reply_message_ = NULL; | 5572 reply_message_ = NULL; |
| 5572 } | 5573 } |
| 5573 | 5574 |
| 5574 void TestingAutomationProvider::OnRemoveProvider() { | 5575 void TestingAutomationProvider::OnRemoveProvider() { |
| 5575 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5576 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5576 } | 5577 } |
| OLD | NEW |