| 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 6556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6567 | 6567 |
| 6568 // Gets the current used encoding name of the page in the specified tab. | 6568 // Gets the current used encoding name of the page in the specified tab. |
| 6569 void TestingAutomationProvider::GetPageCurrentEncoding( | 6569 void TestingAutomationProvider::GetPageCurrentEncoding( |
| 6570 int tab_handle, std::string* current_encoding) { | 6570 int tab_handle, std::string* current_encoding) { |
| 6571 if (tab_tracker_->ContainsHandle(tab_handle)) { | 6571 if (tab_tracker_->ContainsHandle(tab_handle)) { |
| 6572 NavigationController* nav = tab_tracker_->GetResource(tab_handle); | 6572 NavigationController* nav = tab_tracker_->GetResource(tab_handle); |
| 6573 Browser* browser = FindAndActivateTab(nav); | 6573 Browser* browser = FindAndActivateTab(nav); |
| 6574 DCHECK(browser); | 6574 DCHECK(browser); |
| 6575 | 6575 |
| 6576 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) | 6576 if (browser->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU)) |
| 6577 *current_encoding = nav->tab_contents()->encoding(); | 6577 *current_encoding = nav->tab_contents()->GetEncoding(); |
| 6578 } | 6578 } |
| 6579 } | 6579 } |
| 6580 | 6580 |
| 6581 void TestingAutomationProvider::ShutdownSessionService(int handle, | 6581 void TestingAutomationProvider::ShutdownSessionService(int handle, |
| 6582 bool* result) { | 6582 bool* result) { |
| 6583 if (browser_tracker_->ContainsHandle(handle)) { | 6583 if (browser_tracker_->ContainsHandle(handle)) { |
| 6584 Browser* browser = browser_tracker_->GetResource(handle); | 6584 Browser* browser = browser_tracker_->GetResource(handle); |
| 6585 SessionServiceFactory::ShutdownForProfile(browser->profile()); | 6585 SessionServiceFactory::ShutdownForProfile(browser->profile()); |
| 6586 *result = true; | 6586 *result = true; |
| 6587 } else { | 6587 } else { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6673 | 6673 |
| 6674 Send(reply_message_); | 6674 Send(reply_message_); |
| 6675 redirect_query_ = 0; | 6675 redirect_query_ = 0; |
| 6676 reply_message_ = NULL; | 6676 reply_message_ = NULL; |
| 6677 } | 6677 } |
| 6678 | 6678 |
| 6679 void TestingAutomationProvider::OnRemoveProvider() { | 6679 void TestingAutomationProvider::OnRemoveProvider() { |
| 6680 if (g_browser_process) | 6680 if (g_browser_process) |
| 6681 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6681 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6682 } | 6682 } |
| OLD | NEW |