| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "aura/focus_manager.h" | |
| 6 | |
| 7 #include "aura/window.h" | |
| 8 #include "aura/window_delegate.h" | |
| 9 | |
| 10 namespace aura { | |
| 11 namespace internal { | |
| 12 | |
| 13 FocusManager::FocusManager(Window* owner) | |
| 14 : owner_(owner), | |
| 15 focused_window_(NULL) { | |
| 16 } | |
| 17 | |
| 18 FocusManager::~FocusManager() { | |
| 19 } | |
| 20 | |
| 21 void FocusManager::SetFocusedWindow(Window* focused_window) { | |
| 22 if (focused_window == focused_window_) | |
| 23 return; | |
| 24 if (focused_window_) | |
| 25 focused_window_->delegate()->OnBlur(); | |
| 26 focused_window_ = focused_window; | |
| 27 if (focused_window_) | |
| 28 focused_window_->delegate()->OnFocus(); | |
| 29 } | |
| 30 | |
| 31 } // namespace internal | |
| 32 } // namespace aura | |
| OLD | NEW |