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

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

Issue 5075003: Converts usage of SetProp/GetProp to a map. Even after making sure we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp files 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
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 4552de4e92e1d4dce1b6c1487c5c8ceb8f5d8211..1c5c5ee28583b604ff8d32e99297f2b95f6d096d 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -82,6 +82,7 @@
#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"
@@ -99,11 +100,7 @@ using views::GridLayout;
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.
-#if defined(OS_WIN)
-static const wchar_t* kBrowserViewKey = L"__BROWSER_VIEW__";
-#else
-static const char* kBrowserViewKey = "__BROWSER_VIEW__";
-#endif
+static const char* const kBrowserViewKey = "__BROWSER_VIEW__";
// 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).
@@ -486,9 +483,8 @@ BrowserView* BrowserView::GetBrowserViewForNativeWindow(
gfx::NativeWindow window) {
#if defined(OS_WIN)
if (IsWindow(window)) {
- HANDLE data = GetProp(window, kBrowserViewKey);
- if (data)
- return reinterpret_cast<BrowserView*>(data);
+ return reinterpret_cast<BrowserView*>(
+ app::ViewProp::GetValue(window, kBrowserViewKey));
}
#else
if (window) {
@@ -1889,12 +1885,7 @@ void BrowserView::Init() {
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