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

Side by Side Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_container_aura.cc

Issue 8659014: Check that we have a focus manager in aura before trying to set focus. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: use type_popup instead for native_tab_contents_view_aura Created 9 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698