diff options
Diffstat (limited to 'chrome/browser')
19 files changed, 31 insertions, 31 deletions
diff --git a/chrome/browser/chromeos/login/web_page_view.cc b/chrome/browser/chromeos/login/web_page_view.cc index 0ab31ae..0ee2f4d 100644 --- a/chrome/browser/chromeos/login/web_page_view.cc +++ b/chrome/browser/chromeos/login/web_page_view.cc @@ -11,10 +11,10 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/helper.h" #include "chrome/browser/chromeos/login/rounded_rect_painter.h" -#include "chrome/common/bindings_policy.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/webui/web_ui.h" +#include "content/common/bindings_policy.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ipc/ipc_message.h" diff --git a/chrome/browser/debugger/devtools_window.cc b/chrome/browser/debugger/devtools_window.cc index b8a0f8b..bef318d 100644 --- a/chrome/browser/debugger/devtools_window.cc +++ b/chrome/browser/debugger/devtools_window.cc @@ -22,7 +22,6 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -32,6 +31,7 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/common/bindings_policy.h" #include "content/common/notification_service.h" #include "grit/generated_resources.h" diff --git a/chrome/browser/desktop_notification_handler.cc b/chrome/browser/desktop_notification_handler.cc index 986425a..e6654ec 100644 --- a/chrome/browser/desktop_notification_handler.cc +++ b/chrome/browser/desktop_notification_handler.cc @@ -7,6 +7,7 @@ #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/desktop_notification_service_factory.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_view_host_delegate.h" @@ -37,6 +38,16 @@ bool DesktopNotificationHandler::OnMessageReceived( void DesktopNotificationHandler::OnShow( const DesktopNotificationHostMsg_Show_Params& params) { + // Disallow HTML notifications from unwanted schemes. javascript: + // in particular allows unwanted cross-domain access. + GURL url = params.contents_url; + if (!url.SchemeIs(chrome::kHttpScheme) && + !url.SchemeIs(chrome::kHttpsScheme) && + !url.SchemeIs(chrome::kExtensionScheme) && + !url.SchemeIs(chrome::kDataScheme)) { + return; + } + RenderProcessHost* process = render_view_host()->process(); DesktopNotificationService* service = DesktopNotificationServiceFactory::GetForProfile(process->profile()); diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index a930350..142a559 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -24,7 +24,6 @@ #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" @@ -39,6 +38,7 @@ #include "content/browser/site_instance.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/common/bindings_policy.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/view_messages.h" diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc index c6c9611..1a9b122 100644 --- a/chrome/browser/extensions/extension_web_ui.cc +++ b/chrome/browser/extensions/extension_web_ui.cc @@ -18,7 +18,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" @@ -27,6 +26,7 @@ #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_widget_host_view.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/bindings_policy.h" #include "content/common/page_transition_types.h" #include "net/base/file_stream.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 4894c2d..c483a78 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -30,13 +30,13 @@ #include "chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h" #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" #include "chrome/common/automation_messages.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" #include "content/browser/tab_contents/provisional_load_details.h" +#include "content/common/bindings_policy.h" #include "content/common/native_web_keyboard_event.h" #include "content/common/notification_service.h" #include "content/common/page_transition_types.h" diff --git a/chrome/browser/memory_details.cc b/chrome/browser/memory_details.cc index 4510aa5..ea1c834 100644 --- a/chrome/browser/memory_details.cc +++ b/chrome/browser/memory_details.cc @@ -11,7 +11,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_child_process_host.h" @@ -21,6 +20,7 @@ #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/bindings_policy.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/notifications/balloon_host.cc b/chrome/browser/notifications/balloon_host.cc index 1edeb2f..9ac175f 100644 --- a/chrome/browser/notifications/balloon_host.cc +++ b/chrome/browser/notifications/balloon_host.cc @@ -12,11 +12,11 @@ #include "chrome/browser/renderer_preferences_util.h" #include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/site_instance.h" +#include "content/common/bindings_policy.h" #include "content/common/notification_service.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" diff --git a/chrome/browser/prerender/prerender_contents.cc b/chrome/browser/prerender/prerender_contents.cc index ebd530a2..96a7386 100644 --- a/chrome/browser/prerender/prerender_contents.cc +++ b/chrome/browser/prerender/prerender_contents.cc @@ -108,7 +108,6 @@ void PrerenderContents::StartPrerendering() { // Hide the RVH, so that we will run at a lower CPU priority. // Once the RVH is being swapped into a tab, we will Restore it again. render_view_host_->WasHidden(); - render_view_host_->AllowScriptToClose(true); // Register this with the ResourceDispatcherHost as a prerender // RenderViewHost. This must be done before the Navigate message to catch all @@ -439,8 +438,8 @@ bool PrerenderContents::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartProvisionalLoadForFrame, OnDidStartProvisionalLoadForFrame) IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) - IPC_MESSAGE_HANDLER(ViewHostMsg_MaybeCancelPrerender, - OnMaybeCancelPrerender) + IPC_MESSAGE_HANDLER(ViewHostMsg_MaybeCancelPrerenderForHTML5Media, + OnMaybeCancelPrerenderForHTML5Media) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() @@ -479,16 +478,8 @@ void PrerenderContents::OnUpdateFaviconURL( } } -void PrerenderContents::OnMaybeCancelPrerender( - PrerenderCancellationReason reason) { - switch (reason) { - case PRERENDER_CANCELLATION_REASON_HTML5_MEDIA: - Destroy(FINAL_STATUS_HTML5_MEDIA); - return; - default: - LOG(DFATAL) << "Invalid reason " << reason - << " in OnMaybeCancelPrerender."; - } +void PrerenderContents::OnMaybeCancelPrerenderForHTML5Media() { + Destroy(FINAL_STATUS_HTML5_MEDIA); } bool PrerenderContents::AddAliasURL(const GURL& url) { diff --git a/chrome/browser/prerender/prerender_contents.h b/chrome/browser/prerender/prerender_contents.h index 541006a..6d9245d 100644 --- a/chrome/browser/prerender/prerender_contents.h +++ b/chrome/browser/prerender/prerender_contents.h @@ -15,7 +15,6 @@ #include "chrome/browser/tab_contents/render_view_host_delegate_helper.h" #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" #include "chrome/common/icon_messages.h" -#include "chrome/common/prerender_constants.h" #include "chrome/common/view_types.h" #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/common/notification_registrar.h" @@ -208,10 +207,8 @@ class PrerenderContents : public RenderViewHostDelegate, void OnDidStartProvisionalLoadForFrame(int64 frame_id, bool main_frame, const GURL& url); - void OnUpdateFaviconURL(int32 page_id, const std::vector<FaviconURL>& urls); - - void OnMaybeCancelPrerender(PrerenderCancellationReason reason); + void OnMaybeCancelPrerenderForHTML5Media(); // Adds an alias URL, for one of the many redirections. Returns whether // the URL is valid. diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index 5c3c3b1..f560fa6 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -12,7 +12,6 @@ #include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/prerender/prerender_final_status.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/render_messages.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/renderer_host/render_process_host.h" @@ -20,6 +19,7 @@ #include "content/browser/tab_contents/render_view_host_manager.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" #include "googleurl/src/url_parse.h" #include "googleurl/src/url_canon.h" #include "googleurl/src/url_util.h" diff --git a/chrome/browser/sidebar/sidebar_container.cc b/chrome/browser/sidebar/sidebar_container.cc index 529eb8f..c673906 100644 --- a/chrome/browser/sidebar/sidebar_container.cc +++ b/chrome/browser/sidebar/sidebar_container.cc @@ -7,7 +7,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/browser_render_process_host.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/extensions/extension_sidebar_defaults.h" @@ -17,6 +16,7 @@ #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_view.h" +#include "content/common/bindings_policy.h" #include "googleurl/src/gurl.h" #include "third_party/skia/include/core/SkBitmap.h" diff --git a/chrome/browser/tab_contents/background_contents.cc b/chrome/browser/tab_contents/background_contents.cc index 8b30787..c994fad 100644 --- a/chrome/browser/tab_contents/background_contents.cc +++ b/chrome/browser/tab_contents/background_contents.cc @@ -31,7 +31,6 @@ BackgroundContents::BackgroundContents(SiteInstance* site_instance, // TODO(rafaelw): Implement correct session storage. render_view_host_ = new RenderViewHost(site_instance, this, routing_id, NULL); - render_view_host_->AllowScriptToClose(true); // Close ourselves when the application is shutting down. registrar_.Add(this, NotificationType::APP_TERMINATING, diff --git a/chrome/browser/tab_contents/tab_contents_view_mac.mm b/chrome/browser/tab_contents/tab_contents_view_mac.mm index fd2cd1e..cf8efdc 100644 --- a/chrome/browser/tab_contents/tab_contents_view_mac.mm +++ b/chrome/browser/tab_contents/tab_contents_view_mac.mm @@ -28,6 +28,7 @@ #include "content/common/notification_details.h" #include "content/common/notification_source.h" #include "content/common/notification_type.h" +#include "content/common/view_messages.h" #include "skia/ext/skia_utils_mac.h" #import "third_party/mozilla/NSPasteboard+Utils.h" diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index cc26c77..6057195 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -8,7 +8,6 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_value_store.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" @@ -25,6 +24,7 @@ #include "content/browser/tab_contents/navigation_controller.h" #include "content/browser/tab_contents/navigation_entry.h" #include "content/browser/tab_contents/test_tab_contents.h" +#include "content/common/bindings_policy.h" #include "content/common/view_messages.h" #include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc index 23bd6fd..e602095 100644 --- a/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc +++ b/chrome/browser/ui/tab_contents/tab_contents_wrapper.cc @@ -32,6 +32,7 @@ #include "chrome/common/render_messages.h" #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" +#include "content/common/view_messages.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/platform_locale_settings.h" diff --git a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc index 5b4cb24..246c447 100644 --- a/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc +++ b/chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.cc @@ -13,11 +13,11 @@ #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chrome_url_data_manager.h" -#include "chrome/common/bindings_policy.h" #include "chrome/common/jstemplate_builder.h" #include "chrome/common/url_constants.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/bindings_policy.h" #include "content/common/property_bag.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/ui/webui/constrained_html_ui.cc b/chrome/browser/ui/webui/constrained_html_ui.cc index 2bae21f..2e90d0e 100644 --- a/chrome/browser/ui/webui/constrained_html_ui.cc +++ b/chrome/browser/ui/webui/constrained_html_ui.cc @@ -7,9 +7,9 @@ #include "base/lazy_instance.h" #include "base/values.h" #include "chrome/browser/ui/webui/html_dialog_ui.h" -#include "chrome/common/bindings_policy.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/bindings_policy.h" static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> > g_constrained_html_ui_property_accessor(base::LINKER_INITIALIZED); diff --git a/chrome/browser/ui/webui/html_dialog_ui.cc b/chrome/browser/ui/webui/html_dialog_ui.cc index 80872aa..871fea2 100644 --- a/chrome/browser/ui/webui/html_dialog_ui.cc +++ b/chrome/browser/ui/webui/html_dialog_ui.cc @@ -7,9 +7,9 @@ #include "base/callback.h" #include "base/lazy_instance.h" #include "base/values.h" -#include "chrome/common/bindings_policy.h" #include "content/browser/renderer_host/render_view_host.h" #include "content/browser/tab_contents/tab_contents.h" +#include "content/common/bindings_policy.h" static base::LazyInstance<PropertyAccessor<HtmlDialogUIDelegate*> > g_html_dialog_ui_property_accessor(base::LINKER_INITIALIZED); |