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 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 } | 1018 } |
1019 | 1019 |
1020 void TestingAutomationProvider::GetTabTitle(int handle, | 1020 void TestingAutomationProvider::GetTabTitle(int handle, |
1021 int* title_string_size, | 1021 int* title_string_size, |
1022 std::wstring* title) { | 1022 std::wstring* title) { |
1023 *title_string_size = -1; // -1 is the error code | 1023 *title_string_size = -1; // -1 is the error code |
1024 if (tab_tracker_->ContainsHandle(handle)) { | 1024 if (tab_tracker_->ContainsHandle(handle)) { |
1025 NavigationController* tab = tab_tracker_->GetResource(handle); | 1025 NavigationController* tab = tab_tracker_->GetResource(handle); |
1026 NavigationEntry* entry = tab->GetActiveEntry(); | 1026 NavigationEntry* entry = tab->GetActiveEntry(); |
1027 if (entry != NULL) { | 1027 if (entry != NULL) { |
1028 *title = UTF16ToWideHack(entry->GetTitleForDisplay("")); | 1028 // TODO(evan): use directionality of title. |
| 1029 // http://code.google.com/p/chromium/issues/detail?id=27094 |
| 1030 *title = UTF16ToWideHack(entry->GetTitleForDisplay("").string()); |
1029 } else { | 1031 } else { |
1030 *title = std::wstring(); | 1032 *title = std::wstring(); |
1031 } | 1033 } |
1032 *title_string_size = static_cast<int>(title->size()); | 1034 *title_string_size = static_cast<int>(title->size()); |
1033 } | 1035 } |
1034 } | 1036 } |
1035 | 1037 |
1036 void TestingAutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { | 1038 void TestingAutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { |
1037 *tabstrip_index = -1; // -1 is the error code | 1039 *tabstrip_index = -1; // -1 is the error code |
1038 | 1040 |
(...skipping 4485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5524 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5526 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
5525 | 5527 |
5526 Send(reply_message_); | 5528 Send(reply_message_); |
5527 redirect_query_ = 0; | 5529 redirect_query_ = 0; |
5528 reply_message_ = NULL; | 5530 reply_message_ = NULL; |
5529 } | 5531 } |
5530 | 5532 |
5531 void TestingAutomationProvider::OnRemoveProvider() { | 5533 void TestingAutomationProvider::OnRemoveProvider() { |
5532 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5534 AutomationProviderList::GetInstance()->RemoveProvider(this); |
5533 } | 5535 } |
OLD | NEW |