| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ | 5 #ifndef CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ |
| 6 #define CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ | 6 #define CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "build/build_config.h" | |
| 10 | |
| 11 #if defined(OS_WIN) | |
| 12 #include <windows.h> | |
| 13 #endif | |
| 14 | |
| 15 #include <string> | 9 #include <string> |
| 16 #include <vector> | 10 #include <vector> |
| 17 | 11 |
| 18 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 19 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/common/content_settings.h" | 14 #include "chrome/common/content_settings.h" |
| 21 #include "chrome/test/automation/automation_handle_tracker.h" | 15 #include "chrome/test/automation/automation_handle_tracker.h" |
| 22 | 16 |
| 17 class AutocompleteEditProxy; |
| 23 class GURL; | 18 class GURL; |
| 24 class TabProxy; | 19 class TabProxy; |
| 25 class WindowProxy; | 20 class WindowProxy; |
| 26 class AutocompleteEditProxy; | |
| 27 | 21 |
| 28 namespace gfx { | 22 namespace gfx { |
| 29 class Point; | 23 class Point; |
| 30 class Rect; | 24 class Rect; |
| 31 } | 25 } |
| 32 | 26 |
| 33 // This class presents the interface to actions that can be performed on | 27 // This class presents the interface to actions that can be performed on |
| 34 // a given browser window. Note that this object can be invalidated at any | 28 // a given browser window. Note that this object can be invalidated at any |
| 35 // time if the corresponding browser window in the app is closed. In that case, | 29 // time if the corresponding browser window in the app is closed. In that case, |
| 36 // any subsequent calls will return false immediately. | 30 // any subsequent calls will return false immediately. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 49 // success. | 43 // success. |
| 50 bool BringToFront() WARN_UNUSED_RESULT; | 44 bool BringToFront() WARN_UNUSED_RESULT; |
| 51 | 45 |
| 52 // Checks to see if a command is enabled or not. If the call was successful, | 46 // Checks to see if a command is enabled or not. If the call was successful, |
| 53 // puts the result in |enabled| and returns true. | 47 // puts the result in |enabled| and returns true. |
| 54 bool IsMenuCommandEnabled(int id, bool* enabled) WARN_UNUSED_RESULT; | 48 bool IsMenuCommandEnabled(int id, bool* enabled) WARN_UNUSED_RESULT; |
| 55 | 49 |
| 56 // Append a new tab to the TabStrip. The new tab is selected. | 50 // Append a new tab to the TabStrip. The new tab is selected. |
| 57 // The new tab navigates to the given tab_url. | 51 // The new tab navigates to the given tab_url. |
| 58 // Returns true if successful. | 52 // Returns true if successful. |
| 59 // TODO(mpcomplete): If the navigation results in an auth challenge, the | |
| 60 // TabProxy we attach won't know about it. See bug 666730. | |
| 61 bool AppendTab(const GURL& tab_url) WARN_UNUSED_RESULT; | 53 bool AppendTab(const GURL& tab_url) WARN_UNUSED_RESULT; |
| 62 | 54 |
| 63 // Gets the (zero-based) index of the currently active tab. Returns true if | 55 // Gets the (zero-based) index of the currently active tab. Returns true if |
| 64 // successful. | 56 // successful. |
| 65 bool GetActiveTabIndex(int* active_tab_index) const WARN_UNUSED_RESULT; | 57 bool GetActiveTabIndex(int* active_tab_index) const WARN_UNUSED_RESULT; |
| 66 | 58 |
| 67 // Returns the number of tabs in the given window. Returns true if | 59 // Returns the number of tabs in the given window. Returns true if |
| 68 // the call was successful. | 60 // the call was successful. |
| 69 bool GetTabCount(int* num_tabs) const WARN_UNUSED_RESULT; | 61 bool GetTabCount(int* num_tabs) const WARN_UNUSED_RESULT; |
| 70 | 62 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 153 |
| 162 // Editing of the bookmark model. Bookmarks are referenced by id. | 154 // Editing of the bookmark model. Bookmarks are referenced by id. |
| 163 // Bookmark or group (folder) creation: | 155 // Bookmark or group (folder) creation: |
| 164 bool AddBookmarkGroup(int64 parent_id, int index, | 156 bool AddBookmarkGroup(int64 parent_id, int index, |
| 165 std::wstring& title) WARN_UNUSED_RESULT; | 157 std::wstring& title) WARN_UNUSED_RESULT; |
| 166 bool AddBookmarkURL(int64 parent_id, int index, | 158 bool AddBookmarkURL(int64 parent_id, int index, |
| 167 std::wstring& title, const GURL& url) WARN_UNUSED_RESULT; | 159 std::wstring& title, const GURL& url) WARN_UNUSED_RESULT; |
| 168 // Bookmark editing: | 160 // Bookmark editing: |
| 169 bool ReparentBookmark(int64 id, int64 new_parent_id, | 161 bool ReparentBookmark(int64 id, int64 new_parent_id, |
| 170 int index) WARN_UNUSED_RESULT; | 162 int index) WARN_UNUSED_RESULT; |
| 171 bool SetBookmarkTitle(int64 id, std::wstring& title) WARN_UNUSED_RESULT; | 163 bool SetBookmarkTitle(int64 id, const std::wstring& title) WARN_UNUSED_RESULT; |
| 172 bool SetBookmarkURL(int64 id, const GURL& url) WARN_UNUSED_RESULT; | 164 bool SetBookmarkURL(int64 id, const GURL& url) WARN_UNUSED_RESULT; |
| 173 // Finally, bookmark deletion: | 165 // Finally, bookmark deletion: |
| 174 bool RemoveBookmark(int64 id) WARN_UNUSED_RESULT; | 166 bool RemoveBookmark(int64 id) WARN_UNUSED_RESULT; |
| 175 | 167 |
| 176 // Fills |*is_visible| with whether the browser's download shelf is currently | 168 // Fills |*is_visible| with whether the browser's download shelf is currently |
| 177 // visible. The return value indicates success. On failure, |*is_visible| is | 169 // visible. The return value indicates success. On failure, |*is_visible| is |
| 178 // unchanged. | 170 // unchanged. |
| 179 bool IsShelfVisible(bool* is_visible) WARN_UNUSED_RESULT; | 171 bool IsShelfVisible(bool* is_visible) WARN_UNUSED_RESULT; |
| 180 | 172 |
| 181 // Shows or hides the download shelf. | 173 // Shows or hides the download shelf. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 std::vector<float>* stop_times); | 234 std::vector<float>* stop_times); |
| 243 | 235 |
| 244 | 236 |
| 245 protected: | 237 protected: |
| 246 virtual ~BrowserProxy() {} | 238 virtual ~BrowserProxy() {} |
| 247 private: | 239 private: |
| 248 DISALLOW_COPY_AND_ASSIGN(BrowserProxy); | 240 DISALLOW_COPY_AND_ASSIGN(BrowserProxy); |
| 249 }; | 241 }; |
| 250 | 242 |
| 251 #endif // CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ | 243 #endif // CHROME_TEST_AUTOMATION_BROWSER_PROXY_H_ |
| OLD | NEW |