Chromium Code Reviews| 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 "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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |