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

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 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
« no previous file with comments | « ui/views/controls/tree/tree_view.cc ('k') | ui/views/controls/webview/webview_unittest.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) 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 "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/public/browser/browser_accessibility_state.h" 10 #include "content/public/browser/browser_accessibility_state.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 WebContentsObserver::Observe(replacement); 60 WebContentsObserver::Observe(replacement);
61 if (observing_render_process_host_) { 61 if (observing_render_process_host_) {
62 observing_render_process_host_->RemoveObserver(this); 62 observing_render_process_host_->RemoveObserver(this);
63 observing_render_process_host_ = nullptr; 63 observing_render_process_host_ = nullptr;
64 } 64 }
65 if (web_contents() && web_contents()->GetRenderProcessHost()) { 65 if (web_contents() && web_contents()->GetRenderProcessHost()) {
66 observing_render_process_host_ = web_contents()->GetRenderProcessHost(); 66 observing_render_process_host_ = web_contents()->GetRenderProcessHost();
67 observing_render_process_host_->AddObserver(this); 67 observing_render_process_host_->AddObserver(this);
68 } 68 }
69 // web_contents() now returns |replacement| from here onwards. 69 // web_contents() now returns |replacement| from here onwards.
70 SetFocusable(!!web_contents()); 70 SetFocusBehavior(web_contents() ? FocusBehavior::ALWAYS
71 : FocusBehavior::NEVER);
71 if (wc_owner_.get() != replacement) 72 if (wc_owner_.get() != replacement)
72 wc_owner_.reset(); 73 wc_owner_.reset();
73 if (embed_fullscreen_widget_mode_enabled_) { 74 if (embed_fullscreen_widget_mode_enabled_) {
74 is_embedding_fullscreen_widget_ = 75 is_embedding_fullscreen_widget_ =
75 web_contents() && web_contents()->GetFullscreenRenderWidgetHostView(); 76 web_contents() && web_contents()->GetFullscreenRenderWidgetHostView();
76 } else { 77 } else {
77 DCHECK(!is_embedding_fullscreen_widget_); 78 DCHECK(!is_embedding_fullscreen_widget_);
78 } 79 }
79 AttachWebContents(); 80 AttachWebContents();
80 NotifyAccessibilityWebContentsChanged(); 81 NotifyAccessibilityWebContentsChanged();
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 if (!contents) { 383 if (!contents) {
383 content::WebContents::CreateParams create_params( 384 content::WebContents::CreateParams create_params(
384 browser_context, NULL); 385 browser_context, NULL);
385 return content::WebContents::Create(create_params); 386 return content::WebContents::Create(create_params);
386 } 387 }
387 388
388 return contents; 389 return contents;
389 } 390 }
390 391
391 } // namespace views 392 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/tree/tree_view.cc ('k') | ui/views/controls/webview/webview_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698