Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_aur a.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container_aur a.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/browser/tab_contents/interstitial_page.h" | 10 #include "content/browser/tab_contents/interstitial_page.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 106 } | 106 } |
| 107 | 107 |
| 108 void NativeTabContentsContainerAura::RequestFocus() { | 108 void NativeTabContentsContainerAura::RequestFocus() { |
| 109 // This is a hack to circumvent the fact that a the OnFocus() method is not | 109 // This is a hack to circumvent the fact that a the OnFocus() method is not |
| 110 // invoked when RequestFocus() is called on an already focused view. | 110 // invoked when RequestFocus() is called on an already focused view. |
| 111 // The TabContentsContainer is the view focused when the TabContents has | 111 // The TabContentsContainer is the view focused when the TabContents has |
| 112 // focus. When switching between from one tab that has focus to another tab | 112 // focus. When switching between from one tab that has focus to another tab |
| 113 // that should also have focus, RequestFocus() is invoked one the | 113 // that should also have focus, RequestFocus() is invoked one the |
| 114 // TabContentsContainer. In order to make sure OnFocus() is invoked we need | 114 // TabContentsContainer. In order to make sure OnFocus() is invoked we need |
| 115 // to clear the focus before hands. | 115 // to clear the focus before hands. |
| 116 // if (GetFocusManager()) { | |
|
alicet1
2011/12/05 20:21:55
see the native_tab_contents_view_aura.cc in this C
sky
2011/12/05 21:56:41
See my second comment in this thread. A views::Wid
alicet1
2011/12/06 06:28:51
updated. per offline discussion, a test browser wi
| |
| 116 { | 117 { |
| 117 // Disable notifications. Clear focus will assign the focus to the main | 118 // Disable notifications. Clear focus will assign the focus to the main |
| 118 // browser window. Because this change of focus was not user requested, | 119 // browser window. Because this change of focus was not user requested, |
| 119 // don't send it to listeners. | 120 // don't send it to listeners. |
| 120 views::AutoNativeNotificationDisabler local_notification_disabler; | 121 views::AutoNativeNotificationDisabler local_notification_disabler; |
| 121 GetFocusManager()->ClearFocus(); | 122 GetFocusManager()->ClearFocus(); |
| 122 } | 123 } |
| 123 View::RequestFocus(); | 124 View::RequestFocus(); |
| 124 } | 125 } |
| 125 | 126 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 141 } | 142 } |
| 142 | 143 |
| 143 //////////////////////////////////////////////////////////////////////////////// | 144 //////////////////////////////////////////////////////////////////////////////// |
| 144 // NativeTabContentsContainer, public: | 145 // NativeTabContentsContainer, public: |
| 145 | 146 |
| 146 // static | 147 // static |
| 147 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( | 148 NativeTabContentsContainer* NativeTabContentsContainer::CreateNativeContainer( |
| 148 TabContentsContainer* container) { | 149 TabContentsContainer* container) { |
| 149 return new NativeTabContentsContainerAura(container); | 150 return new NativeTabContentsContainerAura(container); |
| 150 } | 151 } |
| OLD | NEW |