diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 03:30:22 +0000 |
commit | 59560e0ba999d5edc33453d4a0fbf44831025817 (patch) | |
tree | f365944f6f0eca593a28747a7fed4caf169578fb /chrome/test/automation | |
parent | 4d2868972ff25746d39ecea58e88480ae0463145 (diff) | |
download | chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.zip chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.gz chromium_src-59560e0ba999d5edc33453d4a0fbf44831025817.tar.bz2 |
Move download shelf from per-tab to per-window. Also disable auto-hiding of
the shelf.
BUG=9025
TEST=Download file in one tab, open new tab, and check that download shelf is
still open. Also try the shelf's close button and the "show all downloads"
link. When saving a file, the download animation should not show up.
Review URL: http://codereview.chromium.org/115740
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 9 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.cc | 23 | ||||
-rw-r--r-- | chrome/test/automation/browser_proxy.h | 8 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 15 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 5 |
5 files changed, 38 insertions, 22 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 3922869..eb8397f 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -232,9 +232,9 @@ IPC_BEGIN_MESSAGES(Automation) // containing the result of a // javascript execution - // Is the Download Shelf visible for the specified tab? + // Is the Download Shelf visible for the specified browser? IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShelfVisibility, - int /* tab_handle */, + int /* browser_handle */, bool /* is_visible */) // This message requests the number of constrained windows in the tab with @@ -927,4 +927,9 @@ IPC_BEGIN_MESSAGES(Automation) IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_SetProxyConfig, std::string /* proxy_config_json_string */) + // Sets Download Shelf visibility for the specified browser. + IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_SetShelfVisibility, + int /* browser_handle */, + bool /* is_visible */) + IPC_END_MESSAGES(Automation) diff --git a/chrome/test/automation/browser_proxy.cc b/chrome/test/automation/browser_proxy.cc index 28dd022..12ab876 100644 --- a/chrome/test/automation/browser_proxy.cc +++ b/chrome/test/automation/browser_proxy.cc @@ -327,6 +327,27 @@ bool BrowserProxy::GetBookmarkBarVisibility(bool* is_visible, 0, handle_, is_visible, is_animating)); } +bool BrowserProxy::IsShelfVisible(bool* is_visible) { + if (!is_valid()) + return false; + + if (!is_visible) { + NOTREACHED(); + return false; + } + + return sender_->Send(new AutomationMsg_ShelfVisibility(0, handle_, + is_visible)); +} + +bool BrowserProxy::SetShelfVisible(bool is_visible) { + if (!is_valid()) + return false; + + return sender_->Send(new AutomationMsg_SetShelfVisibility(0, handle_, + is_visible)); +} + bool BrowserProxy::SetIntPreference(const std::wstring& name, int value) { if (!is_valid()) return false; @@ -414,7 +435,7 @@ scoped_refptr<AutocompleteEditProxy> BrowserProxy::GetAutocompleteEdit() { AutocompleteEditProxy* p = static_cast<AutocompleteEditProxy*>( tracker_->GetResource(autocomplete_edit_handle)); - + if (!p) { p = new AutocompleteEditProxy(sender_, tracker_, autocomplete_edit_handle); p->AddRef(); diff --git a/chrome/test/automation/browser_proxy.h b/chrome/test/automation/browser_proxy.h index 98e64de..8afa0b6 100644 --- a/chrome/test/automation/browser_proxy.h +++ b/chrome/test/automation/browser_proxy.h @@ -186,6 +186,14 @@ class BrowserProxy : public AutomationResourceProxy { // it into position. Returns false on failure. bool GetBookmarkBarVisibility(bool* is_visible, bool* is_animating); + // Fills |*is_visible| with whether the browser's download shelf is currently + // visible. The return value indicates success. On failure, |*is_visible| is + // unchanged. + bool IsShelfVisible(bool* is_visible); + + // Shows or hides the download shelf. + bool SetShelfVisible(bool is_visible); + // Sets the int value of the specified preference. bool SetIntPreference(const std::wstring& name, int value); diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 207efac..0313196 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -42,19 +42,6 @@ bool TabProxy::GetTabIndex(int* index) const { return sender_->Send(new AutomationMsg_TabIndex(0, handle_, index)); } -bool TabProxy::IsShelfVisible(bool* is_visible) { - if (!is_valid()) - return false; - - if (!is_visible) { - NOTREACHED(); - return false; - } - - return sender_->Send(new AutomationMsg_ShelfVisibility(0, handle_, - is_visible)); -} - int TabProxy::FindInPage(const std::wstring& search_string, FindInPageDirection forward, FindInPageCase match_case, @@ -347,7 +334,7 @@ scoped_refptr<ConstrainedWindowProxy> TabProxy::GetConstrainedWindow( window_index, &handle))) return NULL; - + if (handle == 0) return NULL; diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 02bf99e..be6f301 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -174,11 +174,6 @@ class TabProxy : public AutomationResourceProxy { // auth. bool NeedsAuth() const; - // Fills |*is_visible| with whether the tab's download shelf is currently - // visible. The return value indicates success. On failure, |*is_visible| is - // unchanged. - bool IsShelfVisible(bool* is_visible); - // Starts a search within the current tab. The parameter |search_string| // specifies what string to search for, |forward| specifies whether to search // in forward direction, and |match_case| specifies case sensitivity |