| 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/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" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "content/browser/renderer_host/render_widget_host_view.h" | 29 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 30 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 30 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 31 #include "content/browser/renderer_host/resource_request_details.h" | 31 #include "content/browser/renderer_host/resource_request_details.h" |
| 32 #include "content/browser/site_instance_impl.h" | 32 #include "content/browser/site_instance_impl.h" |
| 33 #include "content/browser/tab_contents/interstitial_page_impl.h" | 33 #include "content/browser/tab_contents/interstitial_page_impl.h" |
| 34 #include "content/browser/tab_contents/navigation_entry_impl.h" | 34 #include "content/browser/tab_contents/navigation_entry_impl.h" |
| 35 #include "content/browser/tab_contents/provisional_load_details.h" | 35 #include "content/browser/tab_contents/provisional_load_details.h" |
| 36 #include "content/browser/tab_contents/title_updated_details.h" | 36 #include "content/browser/tab_contents/title_updated_details.h" |
| 37 #include "content/browser/webui/web_ui_impl.h" | 37 #include "content/browser/webui/web_ui_impl.h" |
| 38 #include "content/common/intents_messages.h" | 38 #include "content/common/intents_messages.h" |
| 39 #include "content/common/ssl_status_serialization.h" |
| 39 #include "content/common/view_messages.h" | 40 #include "content/common/view_messages.h" |
| 40 #include "content/public/browser/browser_context.h" | 41 #include "content/public/browser/browser_context.h" |
| 41 #include "content/public/browser/content_browser_client.h" | 42 #include "content/public/browser/content_browser_client.h" |
| 42 #include "content/public/browser/devtools_agent_host_registry.h" | 43 #include "content/public/browser/devtools_agent_host_registry.h" |
| 43 #include "content/public/browser/download_manager.h" | 44 #include "content/public/browser/download_manager.h" |
| 44 #include "content/public/browser/invalidate_type.h" | 45 #include "content/public/browser/invalidate_type.h" |
| 45 #include "content/public/browser/javascript_dialogs.h" | 46 #include "content/public/browser/javascript_dialogs.h" |
| 46 #include "content/public/browser/navigation_details.h" | 47 #include "content/public/browser/navigation_details.h" |
| 47 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/user_metrics.h" | 49 #include "content/public/browser/user_metrics.h" |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 const std::string& http_method, | 1479 const std::string& http_method, |
| 1479 ResourceType::Type resource_type) { | 1480 ResourceType::Type resource_type) { |
| 1480 base::StatsCounter cache("WebKit.CacheHit"); | 1481 base::StatsCounter cache("WebKit.CacheHit"); |
| 1481 cache.Increment(); | 1482 cache.Increment(); |
| 1482 | 1483 |
| 1483 // Send out a notification that we loaded a resource from our memory cache. | 1484 // Send out a notification that we loaded a resource from our memory cache. |
| 1484 int cert_id = 0; | 1485 int cert_id = 0; |
| 1485 net::CertStatus cert_status = 0; | 1486 net::CertStatus cert_status = 0; |
| 1486 int security_bits = -1; | 1487 int security_bits = -1; |
| 1487 int connection_status = 0; | 1488 int connection_status = 0; |
| 1488 SSLManager::DeserializeSecurityInfo(security_info, | 1489 content::DeserializeSecurityInfo(security_info, &cert_id, &cert_status, |
| 1489 &cert_id, &cert_status, | 1490 &security_bits, &connection_status); |
| 1490 &security_bits, | |
| 1491 &connection_status); | |
| 1492 LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->GetID(), | 1491 LoadFromMemoryCacheDetails details(url, GetRenderProcessHost()->GetID(), |
| 1493 cert_id, cert_status); | 1492 cert_id, cert_status); |
| 1494 | 1493 |
| 1495 content::NotificationService::current()->Notify( | 1494 content::NotificationService::current()->Notify( |
| 1496 content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, | 1495 content::NOTIFICATION_LOAD_FROM_MEMORY_CACHE, |
| 1497 content::Source<NavigationController>(&controller_), | 1496 content::Source<NavigationController>(&controller_), |
| 1498 content::Details<LoadFromMemoryCacheDetails>(&details)); | 1497 content::Details<LoadFromMemoryCacheDetails>(&details)); |
| 1499 } | 1498 } |
| 1500 | 1499 |
| 1501 void TabContents::OnDidDisplayInsecureContent() { | 1500 void TabContents::OnDidDisplayInsecureContent() { |
| (...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2471 save_info, | 2470 save_info, |
| 2472 this); | 2471 this); |
| 2473 } | 2472 } |
| 2474 | 2473 |
| 2475 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2474 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
| 2476 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2475 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
| 2477 // Can be NULL during tests. | 2476 // Can be NULL during tests. |
| 2478 if (rwh_view) | 2477 if (rwh_view) |
| 2479 rwh_view->SetSize(GetView()->GetContainerSize()); | 2478 rwh_view->SetSize(GetView()->GetContainerSize()); |
| 2480 } | 2479 } |
| OLD | NEW |