summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 17:04:55 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-02 17:04:55 +0000
commit18db46180363c8705c6e21747b97f4beb00bfa01 (patch)
treee933f71549a0ff6594a16a7d498542512b74cef3 /base
parent1350c0f41aa6842ee0e0b28bce2147fd90cec21b (diff)
downloadchromium_src-18db46180363c8705c6e21747b97f4beb00bfa01.zip
chromium_src-18db46180363c8705c6e21747b97f4beb00bfa01.tar.gz
chromium_src-18db46180363c8705c6e21747b97f4beb00bfa01.tar.bz2
Hide/show cursor according to NSCursor requests.
BUG=http://crbug.com/32703 TEST=when hiding cursor (Flash 10.1), cursor hides (but doesn't stay hidden; that's a different bug) Review URL: http://codereview.chromium.org/560003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37841 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/mac_util.h3
-rw-r--r--base/mac_util.mm7
2 files changed, 10 insertions, 0 deletions
diff --git a/base/mac_util.h b/base/mac_util.h
index 8628e6c..1a0a043 100644
--- a/base/mac_util.h
+++ b/base/mac_util.h
@@ -87,6 +87,9 @@ void RequestFullScreen();
// this will show the menu bar. Must be called on main thread.
void ReleaseFullScreen();
+// Set the visibility of the cursor.
+void SetCursorVisibility(bool visible);
+
// Activates the process with the given PID.
void ActivateProcess(pid_t);
diff --git a/base/mac_util.mm b/base/mac_util.mm
index 1c4ef73b..2975b4e 100644
--- a/base/mac_util.mm
+++ b/base/mac_util.mm
@@ -167,6 +167,13 @@ void ReleaseFullScreen() {
SetSystemUIMode(kUIModeNormal, 0);
}
+void SetCursorVisibility(bool visible) {
+ if (visible)
+ [NSCursor unhide];
+ else
+ [NSCursor hide];
+}
+
void GrabWindowSnapshot(NSWindow* window,
std::vector<unsigned char>* png_representation) {
// Make sure to grab the "window frame" view so we get current tab +