diff options
author | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:29:18 +0000 |
---|---|---|
committer | benrg@chromium.org <benrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-11 00:29:18 +0000 |
commit | 36e4151d009b1ae6274f5af9449e49f3b6e2198f (patch) | |
tree | be96c516fc90ce183cc1671bd670e35dc89ccb42 /ash/ime | |
parent | 557d199404f668006ab48a4ecc1f8e7f3cc2d2ed (diff) | |
download | chromium_src-36e4151d009b1ae6274f5af9449e49f3b6e2198f.zip chromium_src-36e4151d009b1ae6274f5af9449e49f3b6e2198f.tar.gz chromium_src-36e4151d009b1ae6274f5af9449e49f3b6e2198f.tar.bz2 |
aura::Window only supports void* and int values for custom properties, which must be cast to and from the correct type at each use point. This CL introduces typed properties and templated aura::Window::[GS]etProperty methods that enforce the use of the declared type. Only pointer types and integral types that fits in intptr_t are supported, and ownership behavior is the same as before. This CL also adds support for default property values other than NULL/0.
BUG=none
TEST=updated unit tests
Review URL: http://codereview.chromium.org/8533025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121583 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/ime')
-rw-r--r-- | ash/ime/input_method_event_filter.cc | 2 | ||||
-rw-r--r-- | ash/ime/input_method_event_filter_unittest.cc | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/ash/ime/input_method_event_filter.cc b/ash/ime/input_method_event_filter.cc index d9c8e9c..5e45d3e 100644 --- a/ash/ime/input_method_event_filter.cc +++ b/ash/ime/input_method_event_filter.cc @@ -25,7 +25,7 @@ InputMethodEventFilter::InputMethodEventFilter() // result to Init(). input_method_->Init(true); aura::RootWindow::GetInstance()->SetProperty( - aura::client::kRootWindowInputMethod, + aura::client::kRootWindowInputMethodKey, input_method_.get()); } diff --git a/ash/ime/input_method_event_filter_unittest.cc b/ash/ime/input_method_event_filter_unittest.cc index 83fe1fd..432d742 100644 --- a/ash/ime/input_method_event_filter_unittest.cc +++ b/ash/ime/input_method_event_filter_unittest.cc @@ -36,10 +36,12 @@ TEST_F(InputMethodEventFilterTestWithoutShell, TestInputMethodProperty) { aura::RootWindow* root_window = aura::RootWindow::GetInstance(); scoped_ptr<internal::RootWindowEventFilter> root_filter( new internal::RootWindowEventFilter); - EXPECT_FALSE(root_window->GetProperty(aura::client::kRootWindowInputMethod)); + EXPECT_FALSE( + root_window->GetProperty(aura::client::kRootWindowInputMethodKey)); internal::InputMethodEventFilter ime_filter; root_filter->AddFilter(&ime_filter); - EXPECT_TRUE(root_window->GetProperty(aura::client::kRootWindowInputMethod)); + EXPECT_TRUE( + root_window->GetProperty(aura::client::kRootWindowInputMethodKey)); root_filter->RemoveFilter(&ime_filter); } |