Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: ui/views/focus/focus_manager_unittest.cc

Issue 11299219: Rework FocusManager as FocusClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <utility> 5 #include <utility>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "ui/base/accelerators/accelerator.h" 9 #include "ui/base/accelerators/accelerator.h"
10 #include "ui/base/keycodes/keyboard_codes.h" 10 #include "ui/base/keycodes/keyboard_codes.h"
11 #include "ui/views/controls/button/text_button.h" 11 #include "ui/views/controls/button/text_button.h"
12 #include "ui/views/controls/textfield/textfield.h" 12 #include "ui/views/controls/textfield/textfield.h"
13 #include "ui/views/focus/accelerator_handler.h" 13 #include "ui/views/focus/accelerator_handler.h"
14 #include "ui/views/focus/focus_manager_factory.h" 14 #include "ui/views/focus/focus_manager_factory.h"
15 #include "ui/views/focus/focus_manager_test.h" 15 #include "ui/views/focus/focus_manager_test.h"
16 #include "ui/views/focus/widget_focus_manager.h" 16 #include "ui/views/focus/widget_focus_manager.h"
17 #include "ui/views/widget/widget.h" 17 #include "ui/views/widget/widget.h"
18 18
19 #if defined(USE_AURA) 19 #if defined(USE_AURA)
20 #include "ui/aura/focus_manager.h" 20 #include "ui/aura/client/focus_client.h"
21 #include "ui/aura/window.h" 21 #include "ui/aura/window.h"
22 #else 22 #else
23 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" 23 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h"
24 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" 24 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
25 #endif 25 #endif
26 26
27 namespace views { 27 namespace views {
28 28
29 void FocusNativeView(gfx::NativeView view) { 29 void FocusNativeView(gfx::NativeView view) {
30 #if defined(USE_AURA) 30 #if defined(USE_AURA)
31 view->GetFocusManager()->SetFocusedWindow(view, NULL); 31 aura::client::GetFocusClient(view)->FocusWindow(view, NULL);
32 #elif defined(OS_WIN) 32 #elif defined(OS_WIN)
33 SetFocus(view); 33 SetFocus(view);
34 #else 34 #else
35 #error 35 #error
36 #endif 36 #endif
37 } 37 }
38 38
39 enum FocusTestEventType { 39 enum FocusTestEventType {
40 ON_FOCUS = 0, 40 ON_FOCUS = 0,
41 ON_BLUR 41 ON_BLUR
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 views::View* v3 = new View; 697 views::View* v3 = new View;
698 v3->set_focusable(true); 698 v3->set_focusable(true);
699 GetContentsView()->AddChildView(v3); 699 GetContentsView()->AddChildView(v3);
700 700
701 v3->RequestFocus(); 701 v3->RequestFocus();
702 GetWidget()->GetFocusManager()->AdvanceFocus(true); 702 GetWidget()->GetFocusManager()->AdvanceFocus(true);
703 EXPECT_TRUE(v1->HasFocus()); 703 EXPECT_TRUE(v1->HasFocus());
704 } 704 }
705 705
706 } // namespace views 706 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/native/native_view_host_aura.cc ('k') | ui/views/widget/desktop_aura/desktop_activation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698