summaryrefslogtreecommitdiffstats
path: root/base/clipboard.h
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 03:48:48 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-25 03:48:48 +0000
commitca1a894970b9f958198db39413b852a32b03b44f (patch)
treeba74132334f50bdd3e2e93590ff62fff9d033f53 /base/clipboard.h
parent85624c55e5ca0bf002fa9a91f50e89824a3d4db8 (diff)
downloadchromium_src-ca1a894970b9f958198db39413b852a32b03b44f.zip
chromium_src-ca1a894970b9f958198db39413b852a32b03b44f.tar.gz
chromium_src-ca1a894970b9f958198db39413b852a32b03b44f.tar.bz2
Lazily create the clipboard owner window. CreateWindow can take ~.5ms, and we don't need to do this until the clipboard is actually used (ctrl-c/ctrl-v).
Review URL: http://codereview.chromium.org/11398 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5963 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard.h')
-rw-r--r--base/clipboard.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/base/clipboard.h b/base/clipboard.h
index 2943f0e..caf0dbf 100644
--- a/base/clipboard.h
+++ b/base/clipboard.h
@@ -175,7 +175,12 @@ class Clipboard {
// Free a handle depending on its type (as intuited from format)
static void FreeData(FormatType format, HANDLE data);
- HWND clipboard_owner_;
+ // Return the window that should be the clipboard owner, creating it
+ // if neccessary. Marked const for lazily initialization by const methods.
+ HWND GetClipboardWindow() const;
+
+ // Mark this as mutable so const methods can still do lazy initialization.
+ mutable HWND clipboard_owner_;
#elif defined(OS_LINUX)
// Data is stored in the |clipboard_data_| map until it is saved to the system
// clipboard. The Store* functions save data to the |clipboard_data_| map. The