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

Side by Side Diff: content/browser/web_contents/web_contents_impl.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 "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 return view_->GetDropData(); 1995 return view_->GetDropData();
1996 } 1996 }
1997 1997
1998 void WebContentsImpl::Focus() { 1998 void WebContentsImpl::Focus() {
1999 RenderWidgetHostView* const fullscreen_view = 1999 RenderWidgetHostView* const fullscreen_view =
2000 GetFullscreenRenderWidgetHostView(); 2000 GetFullscreenRenderWidgetHostView();
2001 if (fullscreen_view) 2001 if (fullscreen_view)
2002 fullscreen_view->Focus(); 2002 fullscreen_view->Focus();
2003 else 2003 else
2004 view_->Focus(); 2004 view_->Focus();
2005
2006 FOR_EACH_OBSERVER(WebContentsObserver, observers_, WasFocused());
Ben Goodger (Google) 2014/07/30 02:57:26 So you should be able to trigger this off of the F
msw 2014/07/30 03:18:12 I'll look into this, but the WebView doesn't get F
Ben Goodger (Google) 2014/07/30 15:44:02 Not the WebView... view_->Focus() sets focus to an
2005 } 2007 }
2006 2008
2007 void WebContentsImpl::SetInitialFocus() { 2009 void WebContentsImpl::SetInitialFocus() {
2008 RenderWidgetHostView* const fullscreen_view = 2010 RenderWidgetHostView* const fullscreen_view =
2009 GetFullscreenRenderWidgetHostView(); 2011 GetFullscreenRenderWidgetHostView();
2010 if (fullscreen_view) 2012 if (fullscreen_view)
2011 fullscreen_view->Focus(); 2013 fullscreen_view->Focus();
2012 else 2014 else
2013 view_->SetInitialFocus(); 2015 view_->SetInitialFocus();
2014 } 2016 }
(...skipping 2120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4135 if (new_size != old_size) 4137 if (new_size != old_size)
4136 delegate_->UpdatePreferredSize(this, new_size); 4138 delegate_->UpdatePreferredSize(this, new_size);
4137 } 4139 }
4138 4140
4139 void WebContentsImpl::ResumeResponseDeferredAtStart() { 4141 void WebContentsImpl::ResumeResponseDeferredAtStart() {
4140 FrameTreeNode* node = frame_tree_.root(); 4142 FrameTreeNode* node = frame_tree_.root();
4141 node->render_manager()->ResumeResponseDeferredAtStart(); 4143 node->render_manager()->ResumeResponseDeferredAtStart();
4142 } 4144 }
4143 4145
4144 } // namespace content 4146 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc ('k') | content/public/browser/web_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698