| OLD | NEW |
| 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 "chrome/browser/ui/views/tab_contents/native_tab_contents_container_win
.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container_win
.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" | 8 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // focus. When switching between from one tab that has focus to another tab | 113 // focus. When switching between from one tab that has focus to another tab |
| 114 // that should also have focus, RequestFocus() is invoked one the | 114 // that should also have focus, RequestFocus() is invoked one the |
| 115 // TabContentsContainer. In order to make sure OnFocus() is invoked we need | 115 // TabContentsContainer. In order to make sure OnFocus() is invoked we need |
| 116 // to clear the focus before hands. | 116 // to clear the focus before hands. |
| 117 { | 117 { |
| 118 // Disable notifications. Clear focus will assign the focus to the main | 118 // Disable notifications. Clear focus will assign the focus to the main |
| 119 // browser window. Because this change of focus was not user requested, | 119 // browser window. Because this change of focus was not user requested, |
| 120 // don't send it to listeners. | 120 // don't send it to listeners. |
| 121 views::AutoNativeNotificationDisabler local_notification_disabler; | 121 views::AutoNativeNotificationDisabler local_notification_disabler; |
| 122 views::FocusManager* focus_manager = GetFocusManager(); | 122 views::FocusManager* focus_manager = GetFocusManager(); |
| 123 if (focus_manager) // NULL in unittests when using TabContentsViewWin. | 123 if (focus_manager) // NULL in unittests when using WebContentsViewWin. |
| 124 focus_manager->ClearFocus(); | 124 focus_manager->ClearFocus(); |
| 125 } | 125 } |
| 126 View::RequestFocus(); | 126 View::RequestFocus(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void NativeTabContentsContainerWin::AboutToRequestFocusFromTabTraversal( | 129 void NativeTabContentsContainerWin::AboutToRequestFocusFromTabTraversal( |
| 130 bool reverse) { | 130 bool reverse) { |
| 131 container_->web_contents()->FocusThroughTabTraversal(reverse); | 131 container_->web_contents()->FocusThroughTabTraversal(reverse); |
| 132 } | 132 } |
| 133 | 133 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 150 } | 150 } |
| 151 | 151 |
| 152 //////////////////////////////////////////////////////////////////////////////// | 152 //////////////////////////////////////////////////////////////////////////////// |
| 153 // NativeTabContentsContainer, public: | 153 // NativeTabContentsContainer, public: |
| 154 | 154 |
| 155 // static | 155 // static |
| 156 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 156 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 157 TabContentsContainer* container) { | 157 TabContentsContainer* container) { |
| 158 return new NativeTabContentsContainerWin(container); | 158 return new NativeTabContentsContainerWin(container); |
| 159 } | 159 } |
| OLD | NEW |