summaryrefslogtreecommitdiffstats
path: root/chrome/browser/external_tab_container_win.cc
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 18:39:38 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 18:39:38 +0000
commitee3724cc8eb917d0296562fd54d170273d3b8820 (patch)
treefa10206563156f59ce8548c471e223eaf9be8d99 /chrome/browser/external_tab_container_win.cc
parent0f4758f7f597d5f4b608f75aba2cec316d1b62b8 (diff)
downloadchromium_src-ee3724cc8eb917d0296562fd54d170273d3b8820.zip
chromium_src-ee3724cc8eb917d0296562fd54d170273d3b8820.tar.gz
chromium_src-ee3724cc8eb917d0296562fd54d170273d3b8820.tar.bz2
Converts usage of SetProp/GetProp to a map. Even after making sure we
clean up props we still leak in a handful of cases that are causing test grief. By and large our usage of properties is for inside the application, so that a map works fine. BUG=61528 44991 Review URL: http://codereview.chromium.org/5075003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container_win.cc')
-rw-r--r--chrome/browser/external_tab_container_win.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index 41b0a99..a248db2 100644
--- a/chrome/browser/external_tab_container_win.cc
+++ b/chrome/browser/external_tab_container_win.cc
@@ -7,7 +7,7 @@
#include <string>
#include "app/l10n_util.h"
-#include "app/win/scoped_prop.h"
+#include "app/view_prop.h"
#include "base/debug/trace_event.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
@@ -47,7 +47,9 @@
#include "views/widget/root_view.h"
#include "views/window/window.h"
-static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject";
+using app::ViewProp;
+
+static const char kWindowObjectKey[] = "ChromeWindowObject";
// This class overrides the LinkActivated function in the PageInfoBubbleView
// class and routes the help center link navigation to the host browser.
@@ -134,8 +136,7 @@ bool ExternalTabContainer::Init(Profile* profile,
// TODO(jcampan): limit focus traversal to contents.
- prop_.reset(
- new app::win::ScopedProp(GetNativeView(), kWindowObjectKey, this));
+ prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this));
if (existing_contents) {
tab_contents_ = existing_contents;
@@ -284,10 +285,7 @@ void ExternalTabContainer::FocusThroughTabTraversal(
// static
bool ExternalTabContainer::IsExternalTabContainer(HWND window) {
- if (::GetProp(window, kWindowObjectKey) != NULL)
- return true;
-
- return false;
+ return ViewProp::GetValue(window, kWindowObjectKey) != NULL;
}
// static
@@ -301,7 +299,7 @@ ExternalTabContainer* ExternalTabContainer::GetContainerForTab(
return NULL;
}
ExternalTabContainer* container = reinterpret_cast<ExternalTabContainer*>(
- GetProp(parent_window, kWindowObjectKey));
+ ViewProp::GetValue(parent_window, kWindowObjectKey));
return container;
}
@@ -311,8 +309,8 @@ ExternalTabContainer*
gfx::NativeView native_window) {
ExternalTabContainer* tab_container = NULL;
if (native_window) {
- HANDLE handle = ::GetProp(native_window, kWindowObjectKey);
- tab_container = reinterpret_cast<ExternalTabContainer*>(handle);
+ tab_container = reinterpret_cast<ExternalTabContainer*>(
+ ViewProp::GetValue(native_window, kWindowObjectKey));
}
return tab_container;
}