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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (render_frame_host) | 435 if (render_frame_host) |
436 render_frame_message_source_ = render_frame_host; | 436 render_frame_message_source_ = render_frame_host; |
437 else | 437 else |
438 render_view_message_source_ = render_view_host; | 438 render_view_message_source_ = render_view_host; |
439 | 439 |
440 bool handled = true; | 440 bool handled = true; |
441 bool message_is_ok = true; | 441 bool message_is_ok = true; |
442 IPC_BEGIN_MESSAGE_MAP_EX(WebContentsImpl, message, message_is_ok) | 442 IPC_BEGIN_MESSAGE_MAP_EX(WebContentsImpl, message, message_is_ok) |
443 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) | 443 IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung) |
444 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) | 444 IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed) |
| 445 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, |
| 446 OnDomOperationResponse) |
445 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, | 447 IPC_MESSAGE_HANDLER(ViewHostMsg_DidLoadResourceFromMemoryCache, |
446 OnDidLoadResourceFromMemoryCache) | 448 OnDidLoadResourceFromMemoryCache) |
447 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, | 449 IPC_MESSAGE_HANDLER(ViewHostMsg_DidDisplayInsecureContent, |
448 OnDidDisplayInsecureContent) | 450 OnDidDisplayInsecureContent) |
449 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, | 451 IPC_MESSAGE_HANDLER(ViewHostMsg_DidRunInsecureContent, |
450 OnDidRunInsecureContent) | 452 OnDidRunInsecureContent) |
451 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, | 453 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFinishDocumentLoad, |
452 OnDocumentLoadedInFrame) | 454 OnDocumentLoadedInFrame) |
453 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) | 455 IPC_MESSAGE_HANDLER(ViewHostMsg_DidFinishLoad, OnDidFinishLoad) |
454 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) | 456 IPC_MESSAGE_HANDLER(ViewHostMsg_GoToEntryAtOffset, OnGoToEntryAtOffset) |
(...skipping 1927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2382 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2384 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2383 PluginHungStatusChanged(plugin_child_id, path, is_hung)); | 2385 PluginHungStatusChanged(plugin_child_id, path, is_hung)); |
2384 } | 2386 } |
2385 | 2387 |
2386 void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path, | 2388 void WebContentsImpl::OnPluginCrashed(const base::FilePath& plugin_path, |
2387 base::ProcessId plugin_pid) { | 2389 base::ProcessId plugin_pid) { |
2388 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2390 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2389 PluginCrashed(plugin_path, plugin_pid)); | 2391 PluginCrashed(plugin_path, plugin_pid)); |
2390 } | 2392 } |
2391 | 2393 |
| 2394 void WebContentsImpl::OnDomOperationResponse(const std::string& json_string, |
| 2395 int automation_id) { |
| 2396 DomOperationNotificationDetails details(json_string, automation_id); |
| 2397 NotificationService::current()->Notify( |
| 2398 NOTIFICATION_DOM_OPERATION_RESPONSE, |
| 2399 Source<WebContents>(this), |
| 2400 Details<DomOperationNotificationDetails>(&details)); |
| 2401 } |
| 2402 |
2392 void WebContentsImpl::OnAppCacheAccessed(const GURL& manifest_url, | 2403 void WebContentsImpl::OnAppCacheAccessed(const GURL& manifest_url, |
2393 bool blocked_by_policy) { | 2404 bool blocked_by_policy) { |
2394 // Notify observers about navigation. | 2405 // Notify observers about navigation. |
2395 FOR_EACH_OBSERVER(WebContentsObserver, observers_, | 2406 FOR_EACH_OBSERVER(WebContentsObserver, observers_, |
2396 AppCacheAccessed(manifest_url, blocked_by_policy)); | 2407 AppCacheAccessed(manifest_url, blocked_by_policy)); |
2397 } | 2408 } |
2398 | 2409 |
2399 void WebContentsImpl::OnOpenColorChooser( | 2410 void WebContentsImpl::OnOpenColorChooser( |
2400 int color_chooser_id, | 2411 int color_chooser_id, |
2401 SkColor color, | 2412 SkColor color, |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3644 | 3655 |
3645 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { | 3656 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { |
3646 if (!delegate_) | 3657 if (!delegate_) |
3647 return; | 3658 return; |
3648 const gfx::Size new_size = GetPreferredSize(); | 3659 const gfx::Size new_size = GetPreferredSize(); |
3649 if (new_size != old_size) | 3660 if (new_size != old_size) |
3650 delegate_->UpdatePreferredSize(this, new_size); | 3661 delegate_->UpdatePreferredSize(this, new_size); |
3651 } | 3662 } |
3652 | 3663 |
3653 } // namespace content | 3664 } // namespace content |
OLD | NEW |