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

Side by Side Diff: chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc

Issue 418093005: Do not save and restore View focus on aura::Window focus changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Focus the dialog's views::WebView when its content::WebContents is focused. Created 6 years, 4 months 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
OLDNEW
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/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/views/constrained_window_views.h" 8 #include "chrome/browser/ui/views/constrained_window_views.h"
9 #include "content/public/browser/native_web_keyboard_event.h" 9 #include "content/public/browser/native_web_keyboard_event.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { 89 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE {
90 return impl_->ReleaseWebContentsOnDialogClose(); 90 return impl_->ReleaseWebContentsOnDialogClose();
91 } 91 }
92 virtual web_modal::NativeWebContentsModalDialog GetNativeDialog() OVERRIDE { 92 virtual web_modal::NativeWebContentsModalDialog GetNativeDialog() OVERRIDE {
93 return impl_->GetNativeDialog(); 93 return impl_->GetNativeDialog();
94 } 94 }
95 virtual content::WebContents* GetWebContents() OVERRIDE { 95 virtual content::WebContents* GetWebContents() OVERRIDE {
96 return impl_->GetWebContents(); 96 return impl_->GetWebContents();
97 } 97 }
98 98
99 // content::WebContentsObserver:
100 virtual void WasFocused() OVERRIDE {
101 RequestFocus();
102 }
103
99 // views::WidgetDelegate: 104 // views::WidgetDelegate:
100 virtual views::View* GetInitiallyFocusedView() OVERRIDE { 105 virtual views::View* GetInitiallyFocusedView() OVERRIDE {
101 return this; 106 return this;
102 } 107 }
103 virtual void WindowClosing() OVERRIDE { 108 virtual void WindowClosing() OVERRIDE {
104 if (!impl_->closed_via_webui()) 109 if (!impl_->closed_via_webui())
105 GetWebDialogDelegate()->OnDialogClosed(std::string()); 110 GetWebDialogDelegate()->OnDialogClosed(std::string());
106 } 111 }
107 virtual views::Widget* GetWidget() OVERRIDE { 112 virtual views::Widget* GetWidget() OVERRIDE {
108 return View::GetWidget(); 113 return View::GetWidget();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 content::BrowserContext* browser_context, 164 content::BrowserContext* browser_context,
160 WebDialogDelegate* delegate, 165 WebDialogDelegate* delegate,
161 WebDialogWebContentsDelegate* tab_delegate, 166 WebDialogWebContentsDelegate* tab_delegate,
162 content::WebContents* web_contents) { 167 content::WebContents* web_contents) {
163 ConstrainedWebDialogDelegateViewViews* dialog = 168 ConstrainedWebDialogDelegateViewViews* dialog =
164 new ConstrainedWebDialogDelegateViewViews( 169 new ConstrainedWebDialogDelegateViewViews(
165 browser_context, delegate, tab_delegate); 170 browser_context, delegate, tab_delegate);
166 ShowWebModalDialogViews(dialog, web_contents); 171 ShowWebModalDialogViews(dialog, web_contents);
167 return dialog; 172 return dialog;
168 } 173 }
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698