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/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/public/browser/browser_context.h" | 42 #include "content/public/browser/browser_context.h" |
43 #include "content/public/browser/color_chooser.h" | 43 #include "content/public/browser/color_chooser.h" |
44 #include "content/public/browser/content_browser_client.h" | 44 #include "content/public/browser/content_browser_client.h" |
45 #include "content/public/browser/devtools_agent_host_registry.h" | 45 #include "content/public/browser/devtools_agent_host_registry.h" |
46 #include "content/public/browser/download_manager.h" | 46 #include "content/public/browser/download_manager.h" |
47 #include "content/public/browser/download_url_parameters.h" | 47 #include "content/public/browser/download_url_parameters.h" |
48 #include "content/public/browser/invalidate_type.h" | 48 #include "content/public/browser/invalidate_type.h" |
49 #include "content/public/browser/javascript_dialogs.h" | 49 #include "content/public/browser/javascript_dialogs.h" |
50 #include "content/public/browser/load_notification_details.h" | 50 #include "content/public/browser/load_notification_details.h" |
51 #include "content/public/browser/navigation_details.h" | 51 #include "content/public/browser/navigation_details.h" |
| 52 #include "content/public/browser/notification_details.h" |
52 #include "content/public/browser/notification_service.h" | 53 #include "content/public/browser/notification_service.h" |
53 #include "content/public/browser/notification_details.h" | |
54 #include "content/public/browser/resource_request_details.h" | 54 #include "content/public/browser/resource_request_details.h" |
55 #include "content/public/browser/user_metrics.h" | 55 #include "content/public/browser/user_metrics.h" |
56 #include "content/public/browser/web_contents_delegate.h" | 56 #include "content/public/browser/web_contents_delegate.h" |
57 #include "content/public/browser/web_contents_observer.h" | 57 #include "content/public/browser/web_contents_observer.h" |
58 #include "content/public/browser/web_contents_view.h" | 58 #include "content/public/browser/web_contents_view.h" |
59 #include "content/public/browser/web_ui_controller_factory.h" | 59 #include "content/public/browser/web_ui_controller_factory.h" |
60 #include "content/public/common/bindings_policy.h" | 60 #include "content/public/common/bindings_policy.h" |
61 #include "content/public/common/content_constants.h" | 61 #include "content/public/common/content_constants.h" |
62 #include "content/public/common/content_restriction.h" | 62 #include "content/public/common/content_restriction.h" |
63 #include "content/public/common/content_switches.h" | 63 #include "content/public/common/content_switches.h" |
(...skipping 2662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 // in which case we might as well deliver the message anyway. | 2726 // in which case we might as well deliver the message anyway. |
2727 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( | 2727 GetRenderViewHost()->Send(new ViewMsg_PostMessageEvent( |
2728 GetRenderViewHost()->GetRoutingID(), new_params)); | 2728 GetRenderViewHost()->GetRoutingID(), new_params)); |
2729 } | 2729 } |
2730 | 2730 |
2731 void WebContentsImpl::RunJavaScriptMessage( | 2731 void WebContentsImpl::RunJavaScriptMessage( |
2732 RenderViewHost* rvh, | 2732 RenderViewHost* rvh, |
2733 const string16& message, | 2733 const string16& message, |
2734 const string16& default_prompt, | 2734 const string16& default_prompt, |
2735 const GURL& frame_url, | 2735 const GURL& frame_url, |
2736 ui::JavascriptMessageType javascript_message_type, | 2736 content::JavaScriptMessageType javascript_message_type, |
2737 IPC::Message* reply_msg, | 2737 IPC::Message* reply_msg, |
2738 bool* did_suppress_message) { | 2738 bool* did_suppress_message) { |
2739 // Suppress JavaScript dialogs when requested. Also suppress messages when | 2739 // Suppress JavaScript dialogs when requested. Also suppress messages when |
2740 // showing an interstitial as it's shown over the previous page and we don't | 2740 // showing an interstitial as it's shown over the previous page and we don't |
2741 // want the hidden page's dialogs to interfere with the interstitial. | 2741 // want the hidden page's dialogs to interfere with the interstitial. |
2742 bool suppress_this_message = | 2742 bool suppress_this_message = |
2743 static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() || | 2743 static_cast<RenderViewHostImpl*>(rvh)->is_swapped_out() || |
2744 ShowingInterstitialPage() || | 2744 ShowingInterstitialPage() || |
2745 !delegate_ || | 2745 !delegate_ || |
2746 delegate_->ShouldSuppressDialogs() || | 2746 delegate_->ShouldSuppressDialogs() || |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3064 browser_plugin_host()->embedder_render_process_host(); | 3064 browser_plugin_host()->embedder_render_process_host(); |
3065 *embedder_container_id = browser_plugin_host()->instance_id(); | 3065 *embedder_container_id = browser_plugin_host()->instance_id(); |
3066 int embedder_process_id = | 3066 int embedder_process_id = |
3067 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3067 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3068 if (embedder_process_id != -1) { | 3068 if (embedder_process_id != -1) { |
3069 *embedder_channel_name = | 3069 *embedder_channel_name = |
3070 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3070 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3071 embedder_process_id); | 3071 embedder_process_id); |
3072 } | 3072 } |
3073 } | 3073 } |
OLD | NEW |