diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-24 00:26:17 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-24 00:26:17 +0000 |
commit | d2cc6ed02579f9bdedf6d4f81916bc50aeede31b (patch) | |
tree | 5df409d7e48b00eb1fa8985c5e58bd5605de912b /chrome/common | |
parent | e6df36c37320cb2e7febd049eab0adcc13313e70 (diff) | |
download | chromium_src-d2cc6ed02579f9bdedf6d4f81916bc50aeede31b.zip chromium_src-d2cc6ed02579f9bdedf6d4f81916bc50aeede31b.tar.gz chromium_src-d2cc6ed02579f9bdedf6d4f81916bc50aeede31b.tar.bz2 |
Port and enable most of TabRestoreUITest on linux.
- fill in necessary bits of automation proxy, also mock out some windows-only functions on posix so that the IPC messages don't get completely ignored (so we get NOTIMPLEMENTEDs rather than just hanging when porting future UI tests)
- add IsWindowActive to platform_util
Review URL: http://codereview.chromium.org/93096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/platform_util.h | 3 | ||||
-rw-r--r-- | chrome/common/platform_util_linux.cc | 4 | ||||
-rw-r--r-- | chrome/common/platform_util_mac.mm | 5 | ||||
-rw-r--r-- | chrome/common/platform_util_win.cc | 4 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 6 |
5 files changed, 16 insertions, 6 deletions
diff --git a/chrome/common/platform_util.h b/chrome/common/platform_util.h index 3e0edda..bb10140 100644 --- a/chrome/common/platform_util.h +++ b/chrome/common/platform_util.h @@ -21,6 +21,9 @@ gfx::NativeWindow GetTopLevel(gfx::NativeView view); // Get the title of the window. string16 GetWindowTitle(gfx::NativeWindow window); +// Returns true if |window| is the foreground top level window. +bool IsWindowActive(gfx::NativeWindow window); + } #endif // CHROME_COMMON_PLATFORM_UTIL_H_ diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc index 9ef0292..3fd033f 100644 --- a/chrome/common/platform_util_linux.cc +++ b/chrome/common/platform_util_linux.cc @@ -37,4 +37,8 @@ string16 GetWindowTitle(gfx::NativeWindow window) { return UTF8ToUTF16(title); } +bool IsWindowActive(gfx::NativeWindow window) { + return gtk_window_is_active(window); +} + } // namespace platform_util diff --git a/chrome/common/platform_util_mac.mm b/chrome/common/platform_util_mac.mm index d61a50c9..62faf70 100644 --- a/chrome/common/platform_util_mac.mm +++ b/chrome/common/platform_util_mac.mm @@ -39,4 +39,9 @@ string16 GetWindowTitle(gfx::NativeWindow window) { return base::SysNSStringToUTF16(title); } +bool IsWindowActive(gfx::NativeWindow window) { + NOTIMPLEMENTED(); + return false; +} + } // namespace platform_util diff --git a/chrome/common/platform_util_win.cc b/chrome/common/platform_util_win.cc index 1925122..923904d 100644 --- a/chrome/common/platform_util_win.cc +++ b/chrome/common/platform_util_win.cc @@ -93,4 +93,8 @@ string16 GetWindowTitle(gfx::NativeWindow window_handle) { return WideToUTF16(result); } +bool IsWindowActive(gfx::NativeWindow window) { + return ::GetForegroundWindow() == window; +} + } // namespace platform_util diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index e8c76be..9aeb0cc 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -29,12 +29,6 @@ class TabContents; void AutomationProvider::GetActiveWindow(int* handle) { NOTIMPLEMENTED(); } -void AutomationProvider::IsWindowActive(int handle, bool* success, - bool* is_active) { - *success = false; - NOTIMPLEMENTED(); -} - void AutomationProvider::ActivateWindow(int handle) { NOTIMPLEMENTED(); } void AutomationProvider::SetWindowVisible(int handle, bool visible, |