| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 Send(reply_message); | 606 Send(reply_message); |
| 607 } | 607 } |
| 608 | 608 |
| 609 void TestingAutomationProvider::GetBrowserWindowCount(int* window_count) { | 609 void TestingAutomationProvider::GetBrowserWindowCount(int* window_count) { |
| 610 // The automation layer doesn't support non-native desktops. | 610 // The automation layer doesn't support non-native desktops. |
| 611 *window_count = static_cast<int>(BrowserList::GetInstance( | 611 *window_count = static_cast<int>(BrowserList::GetInstance( |
| 612 chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); | 612 chrome::HOST_DESKTOP_TYPE_NATIVE)->size()); |
| 613 } | 613 } |
| 614 | 614 |
| 615 void TestingAutomationProvider::GetNormalBrowserWindowCount(int* window_count) { | 615 void TestingAutomationProvider::GetNormalBrowserWindowCount(int* window_count) { |
| 616 *window_count = static_cast<int>(chrome::GetTabbedBrowserCount(profile_)); | 616 *window_count = static_cast<int>(chrome::GetTabbedBrowserCount( |
| 617 profile_, chrome::HOST_DESKTOP_TYPE_NATIVE)); |
| 617 } | 618 } |
| 618 | 619 |
| 619 void TestingAutomationProvider::GetBrowserWindow(int index, int* handle) { | 620 void TestingAutomationProvider::GetBrowserWindow(int index, int* handle) { |
| 620 *handle = 0; | 621 *handle = 0; |
| 621 Browser* browser = automation_util::GetBrowserAt(index); | 622 Browser* browser = automation_util::GetBrowserAt(index); |
| 622 if (browser) | 623 if (browser) |
| 623 *handle = browser_tracker_->Add(browser); | 624 *handle = browser_tracker_->Add(browser); |
| 624 } | 625 } |
| 625 | 626 |
| 626 void TestingAutomationProvider::ExecuteBrowserCommandAsync(int handle, | 627 void TestingAutomationProvider::ExecuteBrowserCommandAsync(int handle, |
| (...skipping 5285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5912 if (g_browser_process) | 5913 if (g_browser_process) |
| 5913 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5914 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 5914 } | 5915 } |
| 5915 | 5916 |
| 5916 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5917 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 5917 WebContents* tab) { | 5918 WebContents* tab) { |
| 5918 TabStripModel* tab_strip = browser->tab_strip_model(); | 5919 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 5919 if (tab_strip->GetActiveWebContents() != tab) | 5920 if (tab_strip->GetActiveWebContents() != tab) |
| 5920 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5921 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 5921 } | 5922 } |
| OLD | NEW |