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

Side by Side Diff: ui/views/focus/external_focus_tracker.h

Issue 679233002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « ui/views/corewm/tooltip_controller_unittest.cc ('k') | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_ 5 #ifndef UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_
6 #define UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_ 6 #define UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "ui/views/focus/focus_manager.h" 9 #include "ui/views/focus/focus_manager.h"
10 10
(...skipping 11 matching lines...) Expand all
22 // SetFocusManager(NULL) first. 22 // SetFocusManager(NULL) first.
23 // 23 //
24 // Typical use: When a view is added to the view hierarchy, it instantiates an 24 // Typical use: When a view is added to the view hierarchy, it instantiates an
25 // ExternalFocusTracker and passes in itself and its focus manager. Then, 25 // ExternalFocusTracker and passes in itself and its focus manager. Then,
26 // when that view wants to return focus to the last focused view which is not 26 // when that view wants to return focus to the last focused view which is not
27 // itself and not a descandant of itself, (usually when it is being closed) 27 // itself and not a descandant of itself, (usually when it is being closed)
28 // it calls FocusLastFocusedExternalView. 28 // it calls FocusLastFocusedExternalView.
29 class VIEWS_EXPORT ExternalFocusTracker : public FocusChangeListener { 29 class VIEWS_EXPORT ExternalFocusTracker : public FocusChangeListener {
30 public: 30 public:
31 ExternalFocusTracker(View* parent_view, FocusManager* focus_manager); 31 ExternalFocusTracker(View* parent_view, FocusManager* focus_manager);
32 virtual ~ExternalFocusTracker(); 32 ~ExternalFocusTracker() override;
33 33
34 // FocusChangeListener: 34 // FocusChangeListener:
35 virtual void OnWillChangeFocus(View* focused_before, 35 void OnWillChangeFocus(View* focused_before, View* focused_now) override;
36 View* focused_now) override; 36 void OnDidChangeFocus(View* focused_before, View* focused_now) override;
37 virtual void OnDidChangeFocus(View* focused_before,
38 View* focused_now) override;
39 37
40 // Focuses last focused view which is not a child of parent view and is not 38 // Focuses last focused view which is not a child of parent view and is not
41 // parent view itself. Returns true if focus for a view was requested, false 39 // parent view itself. Returns true if focus for a view was requested, false
42 // otherwise. 40 // otherwise.
43 void FocusLastFocusedExternalView(); 41 void FocusLastFocusedExternalView();
44 42
45 // Sets the focus manager whose focus we are tracking. |focus_manager| can 43 // Sets the focus manager whose focus we are tracking. |focus_manager| can
46 // be NULL, but no focus changes will be tracked. This is useful if the focus 44 // be NULL, but no focus changes will be tracked. This is useful if the focus
47 // manager went away, but you might later want to start tracking with a new 45 // manager went away, but you might later want to start tracking with a new
48 // manager later, or call FocusLastFocusedExternalView to focus the previous 46 // manager later, or call FocusLastFocusedExternalView to focus the previous
(...skipping 22 matching lines...) Expand all
71 // The parent view of views which we should not track focus changes to. We 69 // The parent view of views which we should not track focus changes to. We
72 // also do not track changes to parent_view_ itself. 70 // also do not track changes to parent_view_ itself.
73 View* parent_view_; 71 View* parent_view_;
74 72
75 DISALLOW_COPY_AND_ASSIGN(ExternalFocusTracker); 73 DISALLOW_COPY_AND_ASSIGN(ExternalFocusTracker);
76 }; 74 };
77 75
78 } // namespace views 76 } // namespace views
79 77
80 #endif // UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_ 78 #endif // UI_VIEWS_FOCUS_EXTERNAL_FOCUS_TRACKER_H_
OLDNEW
« no previous file with comments | « ui/views/corewm/tooltip_controller_unittest.cc ('k') | ui/views/focus/focus_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698