OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
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" |
11 #include "base/metrics/stats_counters.h" | 11 #include "base/metrics/stats_counters.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/debugger/devtools_manager.h" | 16 #include "chrome/browser/debugger/devtools_manager.h" |
17 #include "chrome/browser/load_from_memory_cache_details.h" | 17 #include "chrome/browser/load_from_memory_cache_details.h" |
18 #include "chrome/browser/notifications/desktop_notification_service.h" | |
19 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | |
20 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
21 #include "content/browser/child_process_security_policy.h" | 19 #include "content/browser/child_process_security_policy.h" |
22 #include "content/browser/content_browser_client.h" | 20 #include "content/browser/content_browser_client.h" |
23 #include "content/browser/host_zoom_map.h" | 21 #include "content/browser/host_zoom_map.h" |
24 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 22 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
25 #include "content/browser/load_notification_details.h" | 23 #include "content/browser/load_notification_details.h" |
26 #include "content/browser/renderer_host/render_process_host.h" | 24 #include "content/browser/renderer_host/render_process_host.h" |
27 #include "content/browser/renderer_host/render_view_host.h" | 25 #include "content/browser/renderer_host/render_view_host.h" |
28 #include "content/browser/renderer_host/render_widget_host_view.h" | 26 #include "content/browser/renderer_host/render_widget_host_view.h" |
29 #include "content/browser/renderer_host/resource_request_details.h" | 27 #include "content/browser/renderer_host/resource_request_details.h" |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 return false; | 1711 return false; |
1714 | 1712 |
1715 return delegate()->IsExternalTabContainer(); | 1713 return delegate()->IsExternalTabContainer(); |
1716 } | 1714 } |
1717 | 1715 |
1718 void TabContents::WorkerCrashed() { | 1716 void TabContents::WorkerCrashed() { |
1719 if (delegate()) | 1717 if (delegate()) |
1720 delegate()->WorkerCrashed(this); | 1718 delegate()->WorkerCrashed(this); |
1721 } | 1719 } |
1722 | 1720 |
1723 void TabContents::RequestDesktopNotificationPermission( | |
1724 const GURL& source_origin, int callback_context) { | |
1725 DesktopNotificationService* service = | |
1726 DesktopNotificationServiceFactory::GetForProfile(profile()); | |
1727 service->RequestPermission( | |
1728 source_origin, GetRenderProcessHost()->id(), | |
1729 render_view_host()->routing_id(), callback_context, this); | |
1730 } | |
1731 | |
1732 void TabContents::BeforeUnloadFiredFromRenderManager( | 1721 void TabContents::BeforeUnloadFiredFromRenderManager( |
1733 bool proceed, | 1722 bool proceed, |
1734 bool* proceed_to_fire_unload) { | 1723 bool* proceed_to_fire_unload) { |
1735 if (delegate()) | 1724 if (delegate()) |
1736 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); | 1725 delegate()->BeforeUnloadFired(this, proceed, proceed_to_fire_unload); |
1737 } | 1726 } |
1738 | 1727 |
1739 void TabContents::DidStartLoadingFromRenderManager( | 1728 void TabContents::DidStartLoadingFromRenderManager( |
1740 RenderViewHost* render_view_host) { | 1729 RenderViewHost* render_view_host) { |
1741 DidStartLoading(); | 1730 DidStartLoading(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1850 | 1839 |
1851 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 1840 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
1852 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 1841 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
1853 rwh_view->SetSize(view()->GetContainerSize()); | 1842 rwh_view->SetSize(view()->GetContainerSize()); |
1854 } | 1843 } |
1855 | 1844 |
1856 void TabContents::OnOnlineStateChanged(bool online) { | 1845 void TabContents::OnOnlineStateChanged(bool online) { |
1857 render_view_host()->Send(new ViewMsg_NetworkStateChanged( | 1846 render_view_host()->Send(new ViewMsg_NetworkStateChanged( |
1858 render_view_host()->routing_id(), online)); | 1847 render_view_host()->routing_id(), online)); |
1859 } | 1848 } |
OLD | NEW |