diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-28 17:20:06 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-28 17:20:06 +0000 |
commit | 170acd4d2ac0b54aa387cf1f8f046d1c096b02a8 (patch) | |
tree | df69ed924758c9bd1185c6a5ebf59310eb33a13c /chrome/test | |
parent | 1d799ddcfcf7925b8fb8aeb6070f33eb5c4e0826 (diff) | |
download | chromium_src-170acd4d2ac0b54aa387cf1f8f046d1c096b02a8.zip chromium_src-170acd4d2ac0b54aa387cf1f8f046d1c096b02a8.tar.gz chromium_src-170acd4d2ac0b54aa387cf1f8f046d1c096b02a8.tar.bz2 |
Changes ui proxy classes to use Browser::Types rather than copying
them.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/343018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30355 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automated_ui_tests/automated_ui_test_base.cc | 2 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.cc | 5 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.h | 3 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.cc | 20 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.h | 10 |
5 files changed, 9 insertions, 31 deletions
diff --git a/chrome/test/automated_ui_tests/automated_ui_test_base.cc b/chrome/test/automated_ui_tests/automated_ui_test_base.cc index 328a411..a12a5fc 100644 --- a/chrome/test/automated_ui_tests/automated_ui_test_base.cc +++ b/chrome/test/automated_ui_tests/automated_ui_test_base.cc @@ -261,7 +261,7 @@ bool AutomatedUITestBase::Home() { bool AutomatedUITestBase::OpenAndActivateNewBrowserWindow( scoped_refptr<BrowserProxy>* previous_browser) { - if (!automation()->OpenNewBrowserWindow(BrowserProxy::TYPE_NORMAL, + if (!automation()->OpenNewBrowserWindow(Browser::TYPE_NORMAL, true /* SW_SHOWNORMAL */)) { LogWarningMessage("failed_to_open_new_browser_window"); return false; diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 4e3b785..698f969 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -485,9 +485,8 @@ void AutomationProxy::InvalidateHandle(const IPC::Message& message) { } } -bool AutomationProxy::OpenNewBrowserWindow(BrowserProxy::Type type, - bool show) { - if (type == BrowserProxy::TYPE_NORMAL) +bool AutomationProxy::OpenNewBrowserWindow(Browser::Type type, bool show) { + if (type == Browser::TYPE_NORMAL) return Send(new AutomationMsg_OpenNewBrowserWindow(0, show)); return Send( new AutomationMsg_OpenNewBrowserWindowOfType(0, static_cast<int>(type), diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index 6825518..aa22ee9 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -15,6 +15,7 @@ #include "base/time.h" #include "base/thread.h" #include "base/waitable_event.h" +#include "chrome/browser/browser.h" #include "chrome/test/automation/automation_constants.h" #include "chrome/test/automation/automation_handle_tracker.h" #include "chrome/test/automation/browser_proxy.h" @@ -89,7 +90,7 @@ class AutomationProxy : public IPC::Channel::Listener, // Open a new browser window of type |type|, returning true on success. |show| // identifies whether the window should be shown. Returns true on success. - bool OpenNewBrowserWindow(BrowserProxy::Type type, bool show); + bool OpenNewBrowserWindow(Browser::Type type, bool show); // Fills the number of open browser windows into the given variable, returning // true on success. False likely indicates an IPC error. diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index ad6c8ff..fcbd4af 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -175,7 +175,7 @@ bool BrowserProxy::GetTabCountWithTimeout(int* num_tabs, uint32 timeout_ms, return succeeded; } -bool BrowserProxy::GetType(Type* type) const { +bool BrowserProxy::GetType(Browser::Type* type) const { if (!is_valid()) return false; @@ -188,23 +188,7 @@ bool BrowserProxy::GetType(Type* type) const { bool succeeded = sender_->SendWithTimeout(new AutomationMsg_Type( 0, handle_, &type_as_int), base::kNoTimeout, NULL); - switch (type_as_int) { - case 0: - *type = TYPE_NORMAL; - break; - case 1: - *type = TYPE_POPUP; - break; - case 2: - *type = TYPE_APP; - break; - case 3: - *type = TYPE_APP_POPUP; - break; - default: - return false; - } - + *type = static_cast<Browser::Type>(type_as_int); return succeeded; } diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h index 447a949..f3641e3 100644 --- a/chrome/test/automation/browser_proxy.h +++ b/chrome/test/automation/browser_proxy.h @@ -13,6 +13,7 @@ #include <string> +#include "chrome/browser/browser.h" #include "chrome/test/automation/automation_handle_tracker.h" class GURL; @@ -31,13 +32,6 @@ namespace gfx { // any subsequent calls will return false immediately. class BrowserProxy : public AutomationResourceProxy { public: - enum Type { - TYPE_NORMAL = 0, - TYPE_POPUP = 1, - TYPE_APP = 2, - TYPE_APP_POPUP = TYPE_APP | TYPE_POPUP, - }; - BrowserProxy(AutomationMessageSender* sender, AutomationHandleTracker* tracker, int handle) @@ -93,7 +87,7 @@ class BrowserProxy : public AutomationResourceProxy { // Returns the type of the given window. Returns true if the call was // successful. - bool GetType(Type* type) const; + bool GetType(Browser::Type* type) const; // Returns the TabProxy for the tab at the given index, transferring // ownership of the pointer to the caller. On failure, returns NULL. |