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

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

Issue 878383002: text input focus: RemoveObserver when RenderProcessHost exits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | 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 "content/public/browser/browser_accessibility_state.h" 7 #include "content/public/browser/browser_accessibility_state.h"
8 #include "content/public/browser/browser_context.h" 8 #include "content/public/browser/browser_context.h"
9 #include "content/public/browser/navigation_controller.h" 9 #include "content/public/browser/navigation_controller.h"
10 #include "content/public/browser/render_process_host.h" 10 #include "content/public/browser/render_process_host.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 // WebView, content::RenderProcessHostObserver implementation: 264 // WebView, content::RenderProcessHostObserver implementation:
265 265
266 void WebView::RenderProcessExited(content::RenderProcessHost* host, 266 void WebView::RenderProcessExited(content::RenderProcessHost* host,
267 base::TerminationStatus status, 267 base::TerminationStatus status,
268 int exit_code) { 268 int exit_code) {
269 NotifyMaybeTextInputClientChanged(); 269 NotifyMaybeTextInputClientChanged();
270 } 270 }
271 271
272 void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) { 272 void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) {
273 DCHECK_EQ(host, observing_render_process_host_); 273 DCHECK_EQ(host, observing_render_process_host_);
274 observing_render_process_host_->RemoveObserver(this);
274 observing_render_process_host_ = nullptr; 275 observing_render_process_host_ = nullptr;
275 } 276 }
276 277
277 //////////////////////////////////////////////////////////////////////////////// 278 ////////////////////////////////////////////////////////////////////////////////
278 // WebView, content::WebContentsDelegate implementation: 279 // WebView, content::WebContentsDelegate implementation:
279 280
280 void WebView::WebContentsFocused(content::WebContents* web_contents) { 281 void WebView::WebContentsFocused(content::WebContents* web_contents) {
281 DCHECK(wc_owner_.get()); 282 DCHECK(wc_owner_.get());
282 // The WebView is only the delegate of WebContentses it creates itself. 283 // The WebView is only the delegate of WebContentses it creates itself.
283 OnWebContentsFocused(wc_owner_.get()); 284 OnWebContentsFocused(wc_owner_.get());
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 if (!contents) { 419 if (!contents) {
419 content::WebContents::CreateParams create_params( 420 content::WebContents::CreateParams create_params(
420 browser_context, NULL); 421 browser_context, NULL);
421 return content::WebContents::Create(create_params); 422 return content::WebContents::Create(create_params);
422 } 423 }
423 424
424 return contents; 425 return contents;
425 } 426 }
426 427
427 } // namespace views 428 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698