summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/views/frame/browser_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/views/frame/browser_view.cc')
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 4552de4..1c5c5ee 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).