diff options
author | sky <sky@chromium.org> | 2016-02-26 17:31:32 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-27 01:32:20 +0000 |
commit | 1468c64622a576044e7cd5d5fe96b175a3c75370 (patch) | |
tree | 02f38c2b286f2e840c279b314a18d3d4461671b7 /ui/aura | |
parent | 301864e18afd79be3857c6101cf856a45016f71f (diff) | |
download | chromium_src-1468c64622a576044e7cd5d5fe96b175a3c75370.zip chromium_src-1468c64622a576044e7cd5d5fe96b175a3c75370.tar.gz chromium_src-1468c64622a576044e7cd5d5fe96b175a3c75370.tar.bz2 |
Fix shelf crash on windows
In debug builds it doesn't appear that windows makes string constants
equal if the text is the same. This means the getter always returned null.
BUG=none
TEST=none
R=msw@chromium.org
Review URL: https://codereview.chromium.org/1736293004
Cr-Commit-Position: refs/heads/master@{#378058}
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/mus/mus_util.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/aura/mus/mus_util.cc b/ui/aura/mus/mus_util.cc index ed57f6a..468b336 100644 --- a/ui/aura/mus/mus_util.cc +++ b/ui/aura/mus/mus_util.cc @@ -5,17 +5,26 @@ #include "ui/aura/mus/mus_util.h" #include "ui/aura/window.h" +#include "ui/aura/window_property.h" namespace aura { +namespace { + +// This code uses Set/GetNativeWindowProperty instead of Set/GetProperty to +// avoid a dependency on mus. +const char kMusWindowKey[] = "mus"; + +} // namespace mus::Window* GetMusWindow(Window* window) { if (!window) return nullptr; - return static_cast<mus::Window*>(window->GetNativeWindowProperty("mus")); + return static_cast<mus::Window*>( + window->GetNativeWindowProperty(kMusWindowKey)); } void SetMusWindow(Window* window, mus::Window* mus_window) { - window->SetNativeWindowProperty("mus", mus_window); + window->SetNativeWindowProperty(kMusWindowKey, mus_window); } } // namespace aura |