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

Side by Side Diff: ui/base/cocoa/focus_tracker.h

Issue 9309042: Move FocusTracker to ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | ui/base/cocoa/focus_tracker.mm » ('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) 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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 8
9 // A class that handles saving and restoring focus. An instance of 9 // A class that handles saving and restoring focus. An instance of
10 // this class snapshots the currently focused view when it is 10 // this class snapshots the currently focused view when it is
11 // constructed, and callers can use restoreFocus to return focus to 11 // constructed, and callers can use restoreFocus to return focus to
12 // that view. FocusTracker will not restore focus to views that are 12 // that view. FocusTracker will not restore focus to views that are
13 // no longer in the view hierarchy or are not in the correct window. 13 // no longer in the view hierarchy or are not in the correct window.
14 14
15 @interface FocusTracker : NSObject { 15 @interface FocusTracker : NSObject {
16 @private 16 @private
17 scoped_nsobject<NSView> focusedView_; 17 scoped_nsobject<NSView> focusedView_;
18 } 18 }
19 19
20 // |window| is the window that we are saving focus for. This 20 // |window| is the window that we are saving focus for. This
21 // method snapshots the currently focused view. 21 // method snapshots the currently focused view.
22 - (id)initWithWindow:(NSWindow*)window; 22 - (id)initWithWindow:(NSWindow*)window;
23 23
24 // Attempts to restore focus to the snapshotted view. Returns YES if 24 // Attempts to restore focus to the snapshotted view. Returns YES if
25 // focus was restored. Will not restore focus if the view is no 25 // focus was restored. Will not restore focus if the view is no
26 // longer in the view hierarchy under |window|. 26 // longer in the view hierarchy under |window|.
27 - (BOOL)restoreFocusInWindow:(NSWindow*)window; 27 - (BOOL)restoreFocusInWindow:(NSWindow*)window;
28 @end 28 @end
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | ui/base/cocoa/focus_tracker.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698