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

Side by Side Diff: ui/aura/focus_manager.cc

Issue 10562025: aura: Fix WidgetFocusChangeListener::OnNativeFocusChange(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge again Created 8 years, 6 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
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 "ui/aura/focus_manager.h" 5 #include "ui/aura/focus_manager.h"
6 6
7 #include "ui/aura/client/activation_client.h" 7 #include "ui/aura/client/activation_client.h"
8 #include "ui/aura/focus_change_observer.h" 8 #include "ui/aura/focus_change_observer.h"
9 #include "ui/aura/window_delegate.h" 9 #include "ui/aura/window_delegate.h"
10 10
(...skipping 30 matching lines...) Expand all
41 focused_window, event)) { 41 focused_window, event)) {
42 return; 42 return;
43 } 43 }
44 } 44 }
45 45
46 Window* old_focused_window = focused_window_; 46 Window* old_focused_window = focused_window_;
47 focused_window_ = focused_window; 47 focused_window_ = focused_window;
48 if (old_focused_window && old_focused_window->delegate()) 48 if (old_focused_window && old_focused_window->delegate())
49 old_focused_window->delegate()->OnBlur(); 49 old_focused_window->delegate()->OnBlur();
50 if (focused_window_ && focused_window_->delegate()) 50 if (focused_window_ && focused_window_->delegate())
51 focused_window_->delegate()->OnFocus(); 51 focused_window_->delegate()->OnFocus(old_focused_window);
52 if (focused_window_) { 52 if (focused_window_) {
53 FOR_EACH_OBSERVER(FocusChangeObserver, observers_, 53 FOR_EACH_OBSERVER(FocusChangeObserver, observers_,
54 OnWindowFocused(focused_window)); 54 OnWindowFocused(focused_window));
55 } 55 }
56 } 56 }
57 57
58 Window* FocusManager::GetFocusedWindow() { 58 Window* FocusManager::GetFocusedWindow() {
59 return focused_window_; 59 return focused_window_;
60 } 60 }
61 61
62 bool FocusManager::IsFocusedWindow(const Window* window) const { 62 bool FocusManager::IsFocusedWindow(const Window* window) const {
63 return focused_window_ == window; 63 return focused_window_ == window;
64 } 64 }
65 65
66 } // namespace ash 66 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698