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:47:05 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-19 18:47:05 +0000
commit28164cbf4787643ad22efc12b439ba0cff93cc63 (patch)
treedc6b1ecd04b34252755b6b6452859cb6ee6ad667 /chrome/browser/external_tab_container_win.cc
parent416ed618e916018bb154acd52fd39ca1198efd22 (diff)
downloadchromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.zip
chromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.tar.gz
chromium_src-28164cbf4787643ad22efc12b439ba0cff93cc63.tar.bz2
Revert 66784 - 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 TBR=sky@chromium.org Review URL: http://codereview.chromium.org/5184009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66786 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, 11 insertions, 9 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc
index a248db2..41b0a99 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/view_prop.h"
+#include "app/win/scoped_prop.h"
#include "base/debug/trace_event.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
@@ -47,9 +47,7 @@
#include "views/widget/root_view.h"
#include "views/window/window.h"
-using app::ViewProp;
-
-static const char kWindowObjectKey[] = "ChromeWindowObject";
+static const wchar_t kWindowObjectKey[] = L"ChromeWindowObject";
// This class overrides the LinkActivated function in the PageInfoBubbleView
// class and routes the help center link navigation to the host browser.
@@ -136,7 +134,8 @@ bool ExternalTabContainer::Init(Profile* profile,
// TODO(jcampan): limit focus traversal to contents.
- prop_.reset(new ViewProp(GetNativeView(), kWindowObjectKey, this));
+ prop_.reset(
+ new app::win::ScopedProp(GetNativeView(), kWindowObjectKey, this));
if (existing_contents) {
tab_contents_ = existing_contents;
@@ -285,7 +284,10 @@ void ExternalTabContainer::FocusThroughTabTraversal(
// static
bool ExternalTabContainer::IsExternalTabContainer(HWND window) {
- return ViewProp::GetValue(window, kWindowObjectKey) != NULL;
+ if (::GetProp(window, kWindowObjectKey) != NULL)
+ return true;
+
+ return false;
}
// static
@@ -299,7 +301,7 @@ ExternalTabContainer* ExternalTabContainer::GetContainerForTab(
return NULL;
}
ExternalTabContainer* container = reinterpret_cast<ExternalTabContainer*>(
- ViewProp::GetValue(parent_window, kWindowObjectKey));
+ GetProp(parent_window, kWindowObjectKey));
return container;
}
@@ -309,8 +311,8 @@ ExternalTabContainer*
gfx::NativeView native_window) {
ExternalTabContainer* tab_container = NULL;
if (native_window) {
- tab_container = reinterpret_cast<ExternalTabContainer*>(
- ViewProp::GetValue(native_window, kWindowObjectKey));
+ HANDLE handle = ::GetProp(native_window, kWindowObjectKey);
+ tab_container = reinterpret_cast<ExternalTabContainer*>(handle);
}
return tab_container;
}