summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 20:27:09 +0000
committerstuartmorgan@google.com <stuartmorgan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 20:27:09 +0000
commitd5a8a426e8b64ac9bfb90873b28f47bb2814899a (patch)
treee5246a855f74c7c128d7c4145ae03e1005d6139f /chrome/common
parent825dd109a3acdcf2640c531068a602dd8f40a196 (diff)
downloadchromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.zip
chromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.tar.gz
chromium_src-d5a8a426e8b64ac9bfb90873b28f47bb2814899a.tar.bz2
Update the Mac plugin dummy window code for the new coordinate system.
Fixes the location of the dummy window, cleans up some duplicate window-handling code, and tries to keep the window activation status more in sync with what it would be in a single-process system. The net result is that event handling in plugins works better, although there are still activation issues. BUG=none TEST=Clicks on plugins should register in the right place (assuming they register at all; there are still bugs in having them handled). Review URL: http://codereview.chromium.org/159525 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/transport_dib.h3
-rw-r--r--chrome/common/transport_dib_linux.cc4
-rw-r--r--chrome/common/transport_dib_mac.cc4
-rw-r--r--chrome/common/transport_dib_win.cc4
4 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/transport_dib.h b/chrome/common/transport_dib.h
index 5712827..495d29f 100644
--- a/chrome/common/transport_dib.h
+++ b/chrome/common/transport_dib.h
@@ -87,6 +87,9 @@ class TransportDIB {
// Map the referenced transport DIB. Returns NULL on failure.
static TransportDIB* Map(Handle transport_dib);
+ // Returns true if the handle is valid.
+ static bool is_valid(Handle dib);
+
// Returns a canvas using the memory of this TransportDIB. The returned
// pointer will be owned by the caller. The bitmap will be of the given size,
// which should fit inside this memory.
diff --git a/chrome/common/transport_dib_linux.cc b/chrome/common/transport_dib_linux.cc
index 75b52d5..d239da2 100644
--- a/chrome/common/transport_dib_linux.cc
+++ b/chrome/common/transport_dib_linux.cc
@@ -81,6 +81,10 @@ TransportDIB* TransportDIB::Map(Handle shmkey) {
return dib;
}
+bool TransportDIB::is_valid(Handle dib) {
+ return dib >= 0;
+}
+
skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
return new skia::PlatformCanvas(w, h, true,
reinterpret_cast<uint8_t*>(memory()));
diff --git a/chrome/common/transport_dib_mac.cc b/chrome/common/transport_dib_mac.cc
index da66085..59b9433 100644
--- a/chrome/common/transport_dib_mac.cc
+++ b/chrome/common/transport_dib_mac.cc
@@ -53,6 +53,10 @@ TransportDIB* TransportDIB::Map(TransportDIB::Handle handle) {
return dib;
}
+bool TransportDIB::is_valid(Handle dib) {
+ return dib.fd >= 0;
+}
+
skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
return new skia::PlatformCanvas(w, h, true,
reinterpret_cast<uint8_t*>(memory()));
diff --git a/chrome/common/transport_dib_win.cc b/chrome/common/transport_dib_win.cc
index 41fe925..3b22038 100644
--- a/chrome/common/transport_dib_win.cc
+++ b/chrome/common/transport_dib_win.cc
@@ -60,6 +60,10 @@ TransportDIB* TransportDIB::Map(TransportDIB::Handle handle) {
return dib;
}
+bool TransportDIB::is_valid(Handle dib) {
+ return dib != NULL;
+}
+
skia::PlatformCanvas* TransportDIB::GetPlatformCanvas(int w, int h) {
return new skia::PlatformCanvas(w, h, true, handle());
}