Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/view.h" | 5 #include "ui/views/view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/compositor/compositor.h" | 24 #include "ui/compositor/compositor.h" |
| 25 #include "ui/compositor/layer.h" | 25 #include "ui/compositor/layer.h" |
| 26 #include "ui/compositor/layer_animator.h" | 26 #include "ui/compositor/layer_animator.h" |
| 27 #include "ui/compositor/paint_context.h" | 27 #include "ui/compositor/paint_context.h" |
| 28 #include "ui/compositor/test/draw_waiter_for_test.h" | 28 #include "ui/compositor/test/draw_waiter_for_test.h" |
| 29 #include "ui/events/event.h" | 29 #include "ui/events/event.h" |
| 30 #include "ui/events/event_utils.h" | 30 #include "ui/events/event_utils.h" |
| 31 #include "ui/events/keycodes/keyboard_codes.h" | 31 #include "ui/events/keycodes/keyboard_codes.h" |
| 32 #include "ui/events/scoped_target_handler.h" | 32 #include "ui/events/scoped_target_handler.h" |
| 33 #include "ui/events/test/event_generator.h" | |
| 33 #include "ui/gfx/canvas.h" | 34 #include "ui/gfx/canvas.h" |
| 34 #include "ui/gfx/path.h" | 35 #include "ui/gfx/path.h" |
| 35 #include "ui/gfx/transform.h" | 36 #include "ui/gfx/transform.h" |
| 36 #include "ui/native_theme/native_theme.h" | 37 #include "ui/native_theme/native_theme.h" |
| 37 #include "ui/strings/grit/ui_strings.h" | 38 #include "ui/strings/grit/ui_strings.h" |
| 38 #include "ui/views/background.h" | 39 #include "ui/views/background.h" |
| 39 #include "ui/views/controls/native/native_view_host.h" | 40 #include "ui/views/controls/native/native_view_host.h" |
| 40 #include "ui/views/controls/scroll_view.h" | 41 #include "ui/views/controls/scroll_view.h" |
| 41 #include "ui/views/controls/textfield/textfield.h" | 42 #include "ui/views/controls/textfield/textfield.h" |
| 42 #include "ui/views/focus/view_storage.h" | 43 #include "ui/views/focus/view_storage.h" |
| (...skipping 2053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2096 } | 2097 } |
| 2097 | 2098 |
| 2098 //////////////////////////////////////////////////////////////////////////////// | 2099 //////////////////////////////////////////////////////////////////////////////// |
| 2099 // Accelerators | 2100 // Accelerators |
| 2100 //////////////////////////////////////////////////////////////////////////////// | 2101 //////////////////////////////////////////////////////////////////////////////// |
| 2101 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { | 2102 bool TestView::AcceleratorPressed(const ui::Accelerator& accelerator) { |
| 2102 accelerator_count_map_[accelerator]++; | 2103 accelerator_count_map_[accelerator]++; |
| 2103 return true; | 2104 return true; |
| 2104 } | 2105 } |
| 2105 | 2106 |
| 2107 namespace { | |
| 2108 | |
| 2109 class TestViewWidget { | |
|
tapted
2016/11/18 07:28:04
nit: comment like
// A Widget with a TestView in
themblsha
2016/11/18 13:31:50
Done.
| |
| 2110 public: | |
| 2111 TestViewWidget(const Widget::InitParams& create_params, | |
| 2112 ui::Accelerator* initial_accelerator, | |
| 2113 bool show_after_init = true) | |
| 2114 : view_(new TestView) { | |
| 2115 view_->Reset(); | |
| 2116 | |
| 2117 // Register a keyboard accelerator before the view is added to a window. | |
| 2118 if (initial_accelerator) { | |
| 2119 view_->AddAccelerator(*initial_accelerator); | |
| 2120 EXPECT_EQ(view_->accelerator_count_map_[*initial_accelerator], 0); | |
| 2121 } | |
| 2122 | |
| 2123 // Create a window and add the view as its child. | |
| 2124 Widget::InitParams params = create_params; | |
| 2125 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 2126 params.bounds = gfx::Rect(0, 0, 100, 100); | |
| 2127 widget_.Init(params); | |
| 2128 View* root = widget_.GetRootView(); | |
| 2129 root->AddChildView(view_); | |
| 2130 if (show_after_init) | |
| 2131 widget_.Show(); | |
| 2132 | |
| 2133 EXPECT_TRUE(widget_.GetFocusManager()); | |
| 2134 } | |
| 2135 | |
| 2136 TestView* view() { return view_; } | |
| 2137 Widget* widget() { return &widget_; } | |
| 2138 | |
| 2139 private: | |
| 2140 TestView* view_; | |
| 2141 Widget widget_; | |
| 2142 | |
| 2143 DISALLOW_COPY_AND_ASSIGN(TestViewWidget); | |
| 2144 }; | |
| 2145 | |
| 2146 } // namespace | |
| 2147 | |
| 2106 // On non-ChromeOS aura there is extra logic to determine whether a view should | 2148 // On non-ChromeOS aura there is extra logic to determine whether a view should |
| 2107 // handle accelerators or not (see View::CanHandleAccelerators for details). | 2149 // handle accelerators or not (see View::CanHandleAccelerators for details). |
| 2108 // This test targets that extra logic, but should also work on other platforms. | 2150 // This test targets that extra logic, but should also work on other platforms. |
| 2109 TEST_F(ViewTest, HandleAccelerator) { | 2151 TEST_F(ViewTest, HandleAccelerator) { |
| 2110 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 2152 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
| 2111 TestView* view = new TestView(); | 2153 TestViewWidget test_widget(CreateParams(Widget::InitParams::TYPE_POPUP), |
| 2112 view->Reset(); | 2154 &return_accelerator); |
| 2113 view->AddAccelerator(return_accelerator); | 2155 TestView* view = test_widget.view(); |
| 2114 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 2156 Widget* widget = test_widget.widget(); |
| 2115 | |
| 2116 // Create a window and add the view as its child. | |
| 2117 std::unique_ptr<Widget> widget(new Widget); | |
| 2118 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); | |
| 2119 params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 2120 params.bounds = gfx::Rect(0, 0, 100, 100); | |
| 2121 widget->Init(params); | |
| 2122 View* root = widget->GetRootView(); | |
| 2123 root->AddChildView(view); | |
| 2124 widget->Show(); | |
| 2125 | |
| 2126 FocusManager* focus_manager = widget->GetFocusManager(); | 2157 FocusManager* focus_manager = widget->GetFocusManager(); |
| 2127 ASSERT_TRUE(focus_manager); | |
| 2128 | 2158 |
| 2129 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 2159 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 2130 // When a non-child view is not active, it shouldn't handle accelerators. | 2160 // When a non-child view is not active, it shouldn't handle accelerators. |
| 2131 EXPECT_FALSE(widget->IsActive()); | 2161 EXPECT_FALSE(widget->IsActive()); |
| 2132 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 2162 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2133 EXPECT_EQ(0, view->accelerator_count_map_[return_accelerator]); | 2163 EXPECT_EQ(0, view->accelerator_count_map_[return_accelerator]); |
| 2134 #endif | 2164 #endif |
| 2135 | 2165 |
| 2136 // TYPE_POPUP widgets default to non-activatable, so the Show() above wouldn't | 2166 // TYPE_POPUP widgets default to non-activatable, so the Show() above wouldn't |
| 2137 // have activated the Widget. First, allow activation. | 2167 // have activated the Widget. First, allow activation. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2174 child_view->accelerator_count_map_[return_accelerator] = 0; | 2204 child_view->accelerator_count_map_[return_accelerator] = 0; |
| 2175 view->accelerator_count_map_[return_accelerator] = 0; | 2205 view->accelerator_count_map_[return_accelerator] = 0; |
| 2176 child_focus_manager->ClearFocus(); | 2206 child_focus_manager->ClearFocus(); |
| 2177 EXPECT_FALSE(child_view->GetWidget()->IsActive()); | 2207 EXPECT_FALSE(child_view->GetWidget()->IsActive()); |
| 2178 EXPECT_TRUE(child_focus_manager->ProcessAccelerator(return_accelerator)); | 2208 EXPECT_TRUE(child_focus_manager->ProcessAccelerator(return_accelerator)); |
| 2179 EXPECT_EQ(0, child_view->accelerator_count_map_[return_accelerator]); | 2209 EXPECT_EQ(0, child_view->accelerator_count_map_[return_accelerator]); |
| 2180 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); | 2210 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); |
| 2181 #endif | 2211 #endif |
| 2182 } | 2212 } |
| 2183 | 2213 |
| 2214 #if defined(OS_MACOSX) | |
|
tapted
2016/11/18 07:28:04
Does this new test need to be OS_MACOSX? (ideally
themblsha
2016/11/18 13:31:50
I'm using EF_COMMAND_DOWN, I think it's not very p
tapted
2016/11/21 06:41:02
Only the first test expectation does, and it would
themblsha
2016/11/21 12:44:20
Done.
| |
| 2215 // Test that BridgedContentView correctly handle Accelerator key events. | |
|
tapted
2016/11/18 07:28:04
nit: handle -> handles
also add
.. key events wh
themblsha
2016/11/18 13:31:50
Done.
| |
| 2216 TEST_F(ViewTest, ActivateAcceleratorOnMac) { | |
|
themblsha
2016/11/17 17:52:16
Here's the test for all the code paths.
| |
| 2217 // Cmd+1 translates to "noop:" command by interpretKeyEvents. | |
| 2218 ui::Accelerator command_accelerator(ui::VKEY_1, ui::EF_COMMAND_DOWN); | |
| 2219 TestViewWidget test_widget(CreateParams(Widget::InitParams::TYPE_POPUP), | |
| 2220 &command_accelerator); | |
| 2221 TestView* view = test_widget.view(); | |
| 2222 | |
| 2223 // Emulate normal event dispatch through -[NSWindow sendEvent:]. | |
| 2224 ui::test::EventGenerator event_generator( | |
| 2225 test_widget.widget()->GetNativeWindow()); | |
| 2226 event_generator.set_target(ui::test::EventGenerator::Target::WINDOW); | |
| 2227 | |
| 2228 event_generator.PressKey(command_accelerator.key_code(), | |
| 2229 command_accelerator.modifiers()); | |
| 2230 event_generator.ReleaseKey(command_accelerator.key_code(), | |
| 2231 command_accelerator.modifiers()); | |
| 2232 EXPECT_EQ(view->accelerator_count_map_[command_accelerator], 1); | |
| 2233 | |
| 2234 // Without an _wantsKeyDownForEvent: override we'll only get a keyUp: event | |
| 2235 // for this accelerator. | |
| 2236 ui::Accelerator key_up_accelerator(ui::VKEY_TAB, | |
| 2237 ui::EF_CONTROL_DOWN | ui::EF_SHIFT_DOWN); | |
| 2238 view->AddAccelerator(key_up_accelerator); | |
| 2239 event_generator.PressKey(key_up_accelerator.key_code(), | |
| 2240 key_up_accelerator.modifiers()); | |
| 2241 event_generator.ReleaseKey(key_up_accelerator.key_code(), | |
| 2242 key_up_accelerator.modifiers()); | |
| 2243 EXPECT_EQ(view->accelerator_count_map_[key_up_accelerator], 1); | |
| 2244 | |
| 2245 // We should handle this accelerator inside keyDown: as it doesn't translate | |
| 2246 // to any command by default. | |
| 2247 ui::Accelerator key_down_accelerator(ui::VKEY_L, ui::EF_COMMAND_DOWN); | |
| 2248 view->AddAccelerator(key_down_accelerator); | |
| 2249 event_generator.PressKey(key_down_accelerator.key_code(), | |
| 2250 key_down_accelerator.modifiers()); | |
| 2251 event_generator.ReleaseKey(key_down_accelerator.key_code(), | |
| 2252 key_down_accelerator.modifiers()); | |
| 2253 EXPECT_EQ(view->accelerator_count_map_[key_down_accelerator], 1); | |
| 2254 } | |
| 2255 #endif // OS_MACOSX | |
| 2256 | |
| 2184 // TODO: these tests were initially commented out when getting aura to | 2257 // TODO: these tests were initially commented out when getting aura to |
| 2185 // run. Figure out if still valuable and either nuke or fix. | 2258 // run. Figure out if still valuable and either nuke or fix. |
| 2186 #if 0 | 2259 #if defined(OS_MACOSX) |
| 2187 TEST_F(ViewTest, ActivateAccelerator) { | 2260 TEST_F(ViewTest, ActivateAccelerator) { |
| 2188 // Register a keyboard accelerator before the view is added to a window. | |
| 2189 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 2261 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
| 2190 TestView* view = new TestView(); | 2262 TestViewWidget test_widget(CreateParams(Widget::InitParams::TYPE_POPUP), |
| 2191 view->Reset(); | 2263 &return_accelerator); |
| 2192 view->AddAccelerator(return_accelerator); | 2264 TestView* view = test_widget.view(); |
| 2193 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 2265 FocusManager* focus_manager = test_widget.widget()->GetFocusManager(); |
| 2194 | |
| 2195 // Create a window and add the view as its child. | |
| 2196 std::unique_ptr<Widget> widget(new Widget); | |
| 2197 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); | |
| 2198 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 2199 params.bounds = gfx::Rect(0, 0, 100, 100); | |
| 2200 widget->Init(params); | |
| 2201 View* root = widget->GetRootView(); | |
| 2202 root->AddChildView(view); | |
| 2203 widget->Show(); | |
| 2204 | |
| 2205 // Get the focus manager. | |
| 2206 FocusManager* focus_manager = widget->GetFocusManager(); | |
| 2207 ASSERT_TRUE(focus_manager); | |
| 2208 | 2266 |
| 2209 // Hit the return key and see if it takes effect. | 2267 // Hit the return key and see if it takes effect. |
| 2210 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); | 2268 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2211 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 1); | 2269 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 1); |
| 2212 | 2270 |
| 2213 // Hit the escape key. Nothing should happen. | 2271 // Hit the escape key. Nothing should happen. |
| 2214 ui::Accelerator escape_accelerator(ui::VKEY_ESCAPE, ui::EF_NONE); | 2272 ui::Accelerator escape_accelerator(ui::VKEY_ESCAPE, ui::EF_NONE); |
| 2215 EXPECT_FALSE(focus_manager->ProcessAccelerator(escape_accelerator)); | 2273 EXPECT_FALSE(focus_manager->ProcessAccelerator(escape_accelerator)); |
| 2216 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 1); | 2274 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 1); |
| 2217 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 0); | 2275 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 0); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 2238 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); | 2296 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); |
| 2239 | 2297 |
| 2240 // Remove all the accelerators. | 2298 // Remove all the accelerators. |
| 2241 view->ResetAccelerators(); | 2299 view->ResetAccelerators(); |
| 2242 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 2300 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2243 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 2); | 2301 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 2); |
| 2244 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); | 2302 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); |
| 2245 EXPECT_FALSE(focus_manager->ProcessAccelerator(escape_accelerator)); | 2303 EXPECT_FALSE(focus_manager->ProcessAccelerator(escape_accelerator)); |
| 2246 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 2); | 2304 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 2); |
| 2247 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); | 2305 EXPECT_EQ(view->accelerator_count_map_[escape_accelerator], 2); |
| 2248 | |
| 2249 widget->CloseNow(); | |
| 2250 } | 2306 } |
| 2251 | 2307 |
| 2252 TEST_F(ViewTest, HiddenViewWithAccelerator) { | 2308 TEST_F(ViewTest, HiddenViewWithAccelerator) { |
| 2253 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 2309 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
| 2254 TestView* view = new TestView(); | 2310 TestViewWidget test_widget(CreateParams(Widget::InitParams::TYPE_POPUP), |
| 2255 view->Reset(); | 2311 &return_accelerator); |
| 2256 view->AddAccelerator(return_accelerator); | 2312 TestView* view = test_widget.view(); |
| 2257 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 2313 FocusManager* focus_manager = test_widget.widget()->GetFocusManager(); |
| 2258 | |
| 2259 std::unique_ptr<Widget> widget(new Widget); | |
| 2260 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); | |
| 2261 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 2262 params.bounds = gfx::Rect(0, 0, 100, 100); | |
| 2263 widget->Init(params); | |
| 2264 View* root = widget->GetRootView(); | |
| 2265 root->AddChildView(view); | |
| 2266 widget->Show(); | |
| 2267 | |
| 2268 FocusManager* focus_manager = widget->GetFocusManager(); | |
| 2269 ASSERT_TRUE(focus_manager); | |
| 2270 | 2314 |
| 2271 view->SetVisible(false); | 2315 view->SetVisible(false); |
| 2272 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 2316 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2273 | 2317 |
| 2274 view->SetVisible(true); | 2318 view->SetVisible(true); |
| 2275 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); | 2319 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2276 | |
| 2277 widget->CloseNow(); | |
| 2278 } | 2320 } |
| 2279 | 2321 |
| 2280 TEST_F(ViewTest, ViewInHiddenWidgetWithAccelerator) { | 2322 TEST_F(ViewTest, ViewInHiddenWidgetWithAccelerator) { |
| 2281 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); | 2323 ui::Accelerator return_accelerator(ui::VKEY_RETURN, ui::EF_NONE); |
| 2282 TestView* view = new TestView(); | 2324 TestViewWidget test_widget(CreateParams(Widget::InitParams::TYPE_POPUP), |
| 2283 view->Reset(); | 2325 &return_accelerator, false); |
| 2284 view->AddAccelerator(return_accelerator); | 2326 TestView* view = test_widget.view(); |
| 2285 EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); | 2327 Widget* widget = test_widget.widget(); |
| 2286 | 2328 FocusManager* focus_manager = test_widget.widget()->GetFocusManager(); |
| 2287 std::unique_ptr<Widget> widget(new Widget); | |
| 2288 Widget::InitParams params = CreateParams(Widget::InitParams::TYPE_POPUP); | |
| 2289 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 2290 params.bounds = gfx::Rect(0, 0, 100, 100); | |
| 2291 widget->Init(params); | |
| 2292 View* root = widget->GetRootView(); | |
| 2293 root->AddChildView(view); | |
| 2294 | |
| 2295 FocusManager* focus_manager = widget->GetFocusManager(); | |
| 2296 ASSERT_TRUE(focus_manager); | |
| 2297 | 2329 |
| 2298 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 2330 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2299 EXPECT_EQ(0, view->accelerator_count_map_[return_accelerator]); | 2331 EXPECT_EQ(0, view->accelerator_count_map_[return_accelerator]); |
| 2300 | 2332 |
| 2301 widget->Show(); | 2333 widget->Show(); |
| 2302 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); | 2334 EXPECT_TRUE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2303 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); | 2335 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); |
| 2304 | 2336 |
| 2305 widget->Hide(); | 2337 widget->Hide(); |
| 2306 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); | 2338 EXPECT_FALSE(focus_manager->ProcessAccelerator(return_accelerator)); |
| 2307 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); | 2339 EXPECT_EQ(1, view->accelerator_count_map_[return_accelerator]); |
| 2340 } | |
| 2341 #endif // OS_MACOSX | |
| 2308 | 2342 |
| 2309 widget->CloseNow(); | 2343 // TODO: these tests were initially commented out when getting aura to |
| 2310 } | 2344 // run. Figure out if still valuable and either nuke or fix. |
| 2311 | 2345 #if 0 |
| 2312 //////////////////////////////////////////////////////////////////////////////// | 2346 //////////////////////////////////////////////////////////////////////////////// |
| 2313 // Mouse-wheel message rerouting | 2347 // Mouse-wheel message rerouting |
| 2314 //////////////////////////////////////////////////////////////////////////////// | 2348 //////////////////////////////////////////////////////////////////////////////// |
| 2315 class ScrollableTestView : public View { | 2349 class ScrollableTestView : public View { |
| 2316 public: | 2350 public: |
| 2317 ScrollableTestView() { } | 2351 ScrollableTestView() { } |
| 2318 | 2352 |
| 2319 virtual gfx::Size GetPreferredSize() { | 2353 virtual gfx::Size GetPreferredSize() { |
| 2320 return gfx::Size(100, 10000); | 2354 return gfx::Size(100, 10000); |
| 2321 } | 2355 } |
| (...skipping 2249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4571 widget.Init(params); | 4605 widget.Init(params); |
| 4572 | 4606 |
| 4573 AddViewWithChildLayer(widget.GetRootView()); | 4607 AddViewWithChildLayer(widget.GetRootView()); |
| 4574 ViewThatAddsViewInOnNativeThemeChanged* v = | 4608 ViewThatAddsViewInOnNativeThemeChanged* v = |
| 4575 new ViewThatAddsViewInOnNativeThemeChanged; | 4609 new ViewThatAddsViewInOnNativeThemeChanged; |
| 4576 widget.GetRootView()->AddChildView(v); | 4610 widget.GetRootView()->AddChildView(v); |
| 4577 EXPECT_TRUE(v->on_native_theme_changed_called()); | 4611 EXPECT_TRUE(v->on_native_theme_changed_called()); |
| 4578 } | 4612 } |
| 4579 | 4613 |
| 4580 } // namespace views | 4614 } // namespace views |
| OLD | NEW |