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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/json_reader.h" | 10 #include "base/json_reader.h" |
(...skipping 1297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 void AutomationProvider::GetActiveTabIndex(int handle, int* active_tab_index) { | 1308 void AutomationProvider::GetActiveTabIndex(int handle, int* active_tab_index) { |
1309 *active_tab_index = -1; // -1 is the error code | 1309 *active_tab_index = -1; // -1 is the error code |
1310 if (browser_tracker_->ContainsHandle(handle)) { | 1310 if (browser_tracker_->ContainsHandle(handle)) { |
1311 Browser* browser = browser_tracker_->GetResource(handle); | 1311 Browser* browser = browser_tracker_->GetResource(handle); |
1312 *active_tab_index = browser->selected_index(); | 1312 *active_tab_index = browser->selected_index(); |
1313 } | 1313 } |
1314 } | 1314 } |
1315 | 1315 |
1316 void AutomationProvider::GetBrowserLocale(string16* locale) { | 1316 void AutomationProvider::GetBrowserLocale(string16* locale) { |
1317 DCHECK(g_browser_process); | 1317 DCHECK(g_browser_process); |
1318 *locale = WideToUTF16(g_browser_process->GetApplicationLocale()); | 1318 *locale = ASCIIToUTF16(g_browser_process->GetApplicationLocale()); |
1319 } | 1319 } |
1320 | 1320 |
1321 void AutomationProvider::GetBrowserWindowCount(int* window_count) { | 1321 void AutomationProvider::GetBrowserWindowCount(int* window_count) { |
1322 *window_count = static_cast<int>(BrowserList::size()); | 1322 *window_count = static_cast<int>(BrowserList::size()); |
1323 } | 1323 } |
1324 | 1324 |
1325 void AutomationProvider::GetNormalBrowserWindowCount(int* window_count) { | 1325 void AutomationProvider::GetNormalBrowserWindowCount(int* window_count) { |
1326 *window_count = static_cast<int>( | 1326 *window_count = static_cast<int>( |
1327 BrowserList::GetBrowserCountForType(profile_, Browser::TYPE_NORMAL)); | 1327 BrowserList::GetBrowserCountForType(profile_, Browser::TYPE_NORMAL)); |
1328 } | 1328 } |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3019 if (container) { | 3019 if (container) { |
3020 *count = static_cast<int>(container->GetBlockedPopupCount()); | 3020 *count = static_cast<int>(container->GetBlockedPopupCount()); |
3021 } else { | 3021 } else { |
3022 // If we don't have a container, we don't have any blocked popups to | 3022 // If we don't have a container, we don't have any blocked popups to |
3023 // contain! | 3023 // contain! |
3024 *count = 0; | 3024 *count = 0; |
3025 } | 3025 } |
3026 } | 3026 } |
3027 } | 3027 } |
3028 } | 3028 } |
OLD | NEW |