Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3511)

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 5184009: Revert 66784 - Converts usage of SetProp/GetProp to a map. Even after making ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/browser_view.cc
===================================================================
--- chrome/browser/ui/views/frame/browser_view.cc (revision 66785)
+++ chrome/browser/ui/views/frame/browser_view.cc (working copy)
@@ -82,7 +82,6 @@
#include "views/window/window.h"
#if defined(OS_WIN)
-#include "app/view_prop.h"
#include "app/win_util.h"
#include "chrome/browser/aeropeek_manager.h"
#include "chrome/browser/jumplist_win.h"
@@ -100,7 +99,11 @@
static const int kStatusBubbleHeight = 20;
// The name of a key to store on the window handle so that other code can
// locate this object using just the handle.
-static const char* const kBrowserViewKey = "__BROWSER_VIEW__";
+#if defined(OS_WIN)
+static const wchar_t* kBrowserViewKey = L"__BROWSER_VIEW__";
+#else
+static const char* kBrowserViewKey = "__BROWSER_VIEW__";
+#endif
// How frequently we check for hung plugin windows.
static const int kDefaultHungPluginDetectFrequency = 2000;
// How long do we wait before we consider a window hung (in ms).
@@ -483,8 +486,9 @@
gfx::NativeWindow window) {
#if defined(OS_WIN)
if (IsWindow(window)) {
- return reinterpret_cast<BrowserView*>(
- app::ViewProp::GetValue(window, kBrowserViewKey));
+ HANDLE data = GetProp(window, kBrowserViewKey);
+ if (data)
+ return reinterpret_cast<BrowserView*>(data);
}
#else
if (window) {
@@ -1885,7 +1889,12 @@
SetLayoutManager(CreateLayoutManager());
// Stow a pointer to this object onto the window handle so that we can get
// at it later when all we have is a native view.
+#if defined(OS_WIN)
GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this);
+#else
+ g_object_set_data(G_OBJECT(GetWidget()->GetNativeView()),
+ kBrowserViewKey, this);
+#endif
// Start a hung plugin window detector for this browser object (as long as
// hang detection is not disabled).
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_win.cc ('k') | views/accessibility/view_accessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698