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