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/extensions/extension_dialog.h" | 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_host.h" | 7 #include "chrome/browser/extensions/extension_host.h" |
8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 void ExtensionDialog::MaybeFocusRenderView() { | 185 void ExtensionDialog::MaybeFocusRenderView() { |
186 views::FocusManager* focus_manager = GetWidget()->GetFocusManager(); | 186 views::FocusManager* focus_manager = GetWidget()->GetFocusManager(); |
187 // Already there's a focused view, so no need to switch the focus. | 187 // Already there's a focused view, so no need to switch the focus. |
188 if (focus_manager && focus_manager->GetFocusedView()) | 188 if (focus_manager && focus_manager->GetFocusedView()) |
189 return; | 189 return; |
190 | 190 |
191 content::RenderWidgetHostView* view = host()->render_view_host()->GetView(); | 191 content::RenderWidgetHostView* view = host()->render_view_host()->GetView(); |
192 if (!view) | 192 if (!view) |
193 return; | 193 return; |
194 | 194 |
195 // TODO(oshima): Views + aura doesn't seem to update the views focus | |
196 // manager when an aura window gets focus. This is a workaround for | |
197 // this issue. Fix it this and remove this workaround. | |
198 // See bug.com/127222. | |
199 focus_manager->SetFocusedView(GetContentsView()); | |
Ben Goodger (Google)
2012/07/11 16:06:38
So who's going to fix the underlying issue?
SeRya
2012/07/11 16:39:44
@oshima
| |
195 view->Focus(); | 200 view->Focus(); |
sky
2012/06/28 22:47:51
I have a feeling views doesn't get focus because N
SeRya
2012/06/29 09:35:55
ExtensionView does have focused view (host->view()
| |
196 } | 201 } |
197 | 202 |
198 ///////////////////////////////////////////////////////////////////////////// | 203 ///////////////////////////////////////////////////////////////////////////// |
199 // views::WidgetDelegate overrides. | 204 // views::WidgetDelegate overrides. |
200 | 205 |
201 bool ExtensionDialog::CanResize() const { | 206 bool ExtensionDialog::CanResize() const { |
202 return false; | 207 return false; |
203 } | 208 } |
204 | 209 |
205 ui::ModalType ExtensionDialog::GetModalType() const { | 210 ui::ModalType ExtensionDialog::GetModalType() const { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 if (content::Details<ExtensionHost>(host()) != details) | 267 if (content::Details<ExtensionHost>(host()) != details) |
263 return; | 268 return; |
264 if (observer_) | 269 if (observer_) |
265 observer_->ExtensionTerminated(this); | 270 observer_->ExtensionTerminated(this); |
266 break; | 271 break; |
267 default: | 272 default: |
268 NOTREACHED() << L"Received unexpected notification"; | 273 NOTREACHED() << L"Received unexpected notification"; |
269 break; | 274 break; |
270 } | 275 } |
271 } | 276 } |
OLD | NEW |