summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 20:13:58 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-21 20:13:58 +0000
commitabcfa65ad3be10658bfcf6262c152cae8588dc90 (patch)
treee602b146f430556c7cf608c4b9701ee7478380c6 /chrome/browser/automation
parent7caa95de14beff32bc64fa9f2cfcba30d93fd0e0 (diff)
downloadchromium_src-abcfa65ad3be10658bfcf6262c152cae8588dc90.zip
chromium_src-abcfa65ad3be10658bfcf6262c152cae8588dc90.tar.gz
chromium_src-abcfa65ad3be10658bfcf6262c152cae8588dc90.tar.bz2
Merge BrowserListImpl into BrowserList.
Kept AddBrowser and RemoveBrowser static (having it access the private members of the appropriate list for the browser added/removed); kept AddObserver and RemoveObserver static so that observers are notified about browser additions, removals, and set actives on every desktop (observers should filter if they so desire). The only calls that are not-static (i.e. for which consumers need to be aware of HostDesktopType) are: iterators, size(), empty(), get(), and GetLastActive(). All the consumers were already made multi-desktop aware in the multiple CLs preceding this one :)! BUG=129187, 177341 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=183580 Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=183701 Review URL: https://chromiumcodereview.appspot.com/12281006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183853 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc6
-rw-r--r--chrome/browser/automation/automation_util.cc6
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc10
3 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 4e7dffd..bf80305 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -55,7 +55,7 @@
#include "chrome/browser/sessions/tab_restore_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_iterator.h"
-#include "chrome/browser/ui/browser_list_impl.h"
+#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/find_bar/find_notification_details.h"
#include "chrome/browser/ui/host_desktop.h"
@@ -821,7 +821,7 @@ void BrowserClosedNotificationObserver::Observe(
}
// The automation layer doesn't support non-native desktops.
- int browser_count = static_cast<int>(chrome::BrowserListImpl::GetInstance(
+ int browser_count = static_cast<int>(BrowserList::GetInstance(
chrome::HOST_DESKTOP_TYPE_NATIVE)->size());
// We get the notification before the browser is removed from the BrowserList.
bool app_closing = browser_count == 1;
@@ -871,7 +871,7 @@ void BrowserCountChangeNotificationObserver::Observe(
type == chrome::NOTIFICATION_BROWSER_CLOSED);
// The automation layer doesn't support non-native desktops.
- int current_count = static_cast<int>(chrome::BrowserListImpl::GetInstance(
+ int current_count = static_cast<int>(BrowserList::GetInstance(
chrome::HOST_DESKTOP_TYPE_NATIVE)->size());
if (type == chrome::NOTIFICATION_BROWSER_CLOSED) {
// At the time of the notification the browser being closed is not removed
diff --git a/chrome/browser/automation/automation_util.cc b/chrome/browser/automation/automation_util.cc
index b844bac..97978f21 100644
--- a/chrome/browser/automation/automation_util.cc
+++ b/chrome/browser/automation/automation_util.cc
@@ -27,7 +27,7 @@
#include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_iterator.h"
-#include "chrome/browser/ui/browser_list_impl.h"
+#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/view_type_utils.h"
@@ -156,8 +156,8 @@ namespace automation_util {
Browser* GetBrowserAt(int index) {
// The automation layer doesn't support non-native desktops.
- chrome::BrowserListImpl* native_list =
- chrome::BrowserListImpl::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE);
+ BrowserList* native_list =
+ BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE);
if (index < 0 || index >= static_cast<int>(native_list->size()))
return NULL;
return native_list->get(index);
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 030501c..51edc54 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -93,7 +93,6 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_iterator.h"
#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_list_impl.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
@@ -290,8 +289,7 @@ void TestingAutomationProvider::OnBrowserRemoved(Browser* browser) {
// want the automation provider (and hence the process) to go away when the
// last browser goes away.
// The automation layer doesn't support non-native desktops.
- if (chrome::BrowserListImpl::GetInstance(
- chrome::HOST_DESKTOP_TYPE_NATIVE)->empty() &&
+ if (BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty() &&
!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kKeepAliveForTest)) {
// If you change this, update Observer for chrome::SESSION_END
@@ -610,7 +608,7 @@ void TestingAutomationProvider::Reload(int handle,
void TestingAutomationProvider::GetBrowserWindowCount(int* window_count) {
// The automation layer doesn't support non-native desktops.
- *window_count = static_cast<int>(chrome::BrowserListImpl::GetInstance(
+ *window_count = static_cast<int>(BrowserList::GetInstance(
chrome::HOST_DESKTOP_TYPE_NATIVE)->size());
}
@@ -1129,7 +1127,7 @@ void TestingAutomationProvider::GetBrowserWindowCountJSON(
DictionaryValue dict;
// The automation layer doesn't support non-native desktops.
dict.SetInteger("count",
- static_cast<int>(chrome::BrowserListImpl::GetInstance(
+ static_cast<int>(BrowserList::GetInstance(
chrome::HOST_DESKTOP_TYPE_NATIVE)->size()));
AutomationJSONReply(this, reply_message).SendSuccess(&dict);
}
@@ -1521,7 +1519,7 @@ void TestingAutomationProvider::WaitForBrowserWindowCountToBecome(
int target_count,
IPC::Message* reply_message) {
// The automation layer doesn't support non-native desktops.
- int current_count = static_cast<int>(chrome::BrowserListImpl::GetInstance(
+ int current_count = static_cast<int>(BrowserList::GetInstance(
chrome::HOST_DESKTOP_TYPE_NATIVE)->size());
if (current_count == target_count) {
AutomationMsg_WaitForBrowserWindowCountToBecome::WriteReplyParams(