| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1740 *tab_handle = tab_tracker_->Add(&tab_contents->controller()); | 1740 *tab_handle = tab_tracker_->Add(&tab_contents->controller()); |
| 1741 } | 1741 } |
| 1742 } | 1742 } |
| 1743 } | 1743 } |
| 1744 | 1744 |
| 1745 void AutomationProvider::GetTabTitle(int handle, int* title_string_size, | 1745 void AutomationProvider::GetTabTitle(int handle, int* title_string_size, |
| 1746 std::wstring* title) { | 1746 std::wstring* title) { |
| 1747 *title_string_size = -1; // -1 is the error code | 1747 *title_string_size = -1; // -1 is the error code |
| 1748 if (tab_tracker_->ContainsHandle(handle)) { | 1748 if (tab_tracker_->ContainsHandle(handle)) { |
| 1749 NavigationController* tab = tab_tracker_->GetResource(handle); | 1749 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 1750 *title = UTF16ToWideHack(tab->GetActiveEntry()->title()); | 1750 NavigationEntry* entry = tab->GetActiveEntry(); |
| 1751 *title = std::wstring(); |
| 1752 if (entry != NULL) { |
| 1753 *title = UTF16ToWideHack(entry->title()); |
| 1754 } |
| 1751 *title_string_size = static_cast<int>(title->size()); | 1755 *title_string_size = static_cast<int>(title->size()); |
| 1752 } | 1756 } |
| 1753 } | 1757 } |
| 1754 | 1758 |
| 1755 void AutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { | 1759 void AutomationProvider::GetTabIndex(int handle, int* tabstrip_index) { |
| 1756 *tabstrip_index = -1; // -1 is the error code | 1760 *tabstrip_index = -1; // -1 is the error code |
| 1757 | 1761 |
| 1758 if (tab_tracker_->ContainsHandle(handle)) { | 1762 if (tab_tracker_->ContainsHandle(handle)) { |
| 1759 NavigationController* tab = tab_tracker_->GetResource(handle); | 1763 NavigationController* tab = tab_tracker_->GetResource(handle); |
| 1760 Browser* browser = Browser::GetBrowserForController(tab, NULL); | 1764 Browser* browser = Browser::GetBrowserForController(tab, NULL); |
| (...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2877 DLOG(WARNING) << "SetParent failed. Error 0x%x" << GetLastError(); | 2881 DLOG(WARNING) << "SetParent failed. Error 0x%x" << GetLastError(); |
| 2878 } | 2882 } |
| 2879 } | 2883 } |
| 2880 } | 2884 } |
| 2881 #endif | 2885 #endif |
| 2882 | 2886 |
| 2883 void AutomationProvider::GetWindowTitle(int handle, string16* text) { | 2887 void AutomationProvider::GetWindowTitle(int handle, string16* text) { |
| 2884 gfx::NativeWindow window = window_tracker_->GetResource(handle); | 2888 gfx::NativeWindow window = window_tracker_->GetResource(handle); |
| 2885 text->assign(platform_util::GetWindowTitle(window)); | 2889 text->assign(platform_util::GetWindowTitle(window)); |
| 2886 } | 2890 } |
| OLD | NEW |