OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/frame/top_container_view.h" | 5 #include "chrome/browser/ui/views/frame/top_container_view.h" |
6 | 6 |
7 #include "chrome/browser/ui/views/frame/browser_frame.h" | 7 #include "chrome/browser/ui/views/frame/browser_frame.h" |
8 #include "chrome/browser/ui/views/frame/browser_view.h" | 8 #include "chrome/browser/ui/views/frame/browser_view.h" |
9 #include "chrome/browser/ui/views/immersive_mode_controller.h" | 9 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
10 | 10 |
11 TopContainerView::TopContainerView(BrowserView* browser_view) | 11 TopContainerView::TopContainerView(BrowserView* browser_view) |
12 : browser_view_(browser_view), | 12 : browser_view_(browser_view), |
13 focus_manager_(browser_view->GetFocusManager()) { | 13 focus_manager_(browser_view->GetFocusManager()) { |
14 focus_manager_->AddFocusChangeListener(this); | 14 focus_manager_->AddFocusChangeListener(this); |
15 } | 15 } |
16 | 16 |
17 TopContainerView::~TopContainerView() { | 17 TopContainerView::~TopContainerView() { |
18 focus_manager_->RemoveFocusChangeListener(this); | 18 focus_manager_->RemoveFocusChangeListener(this); |
19 } | 19 } |
(...skipping 20 matching lines...) Expand all Loading... |
40 | 40 |
41 void TopContainerView::OnDidChangeFocus(View* focused_before, | 41 void TopContainerView::OnDidChangeFocus(View* focused_before, |
42 View* focused_now) { | 42 View* focused_now) { |
43 // If one of this view's children had focus before, but doesn't have focus | 43 // If one of this view's children had focus before, but doesn't have focus |
44 // now, we may want to slide out the top views in immersive fullscreen. | 44 // now, we may want to slide out the top views in immersive fullscreen. |
45 if (browser_view_->immersive_mode_controller()->enabled() && | 45 if (browser_view_->immersive_mode_controller()->enabled() && |
46 Contains(focused_before) && | 46 Contains(focused_before) && |
47 !Contains(focused_now)) | 47 !Contains(focused_now)) |
48 browser_view_->immersive_mode_controller()->OnRevealViewLostFocus(); | 48 browser_view_->immersive_mode_controller()->OnRevealViewLostFocus(); |
49 } | 49 } |
OLD | NEW |