OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/gears_integration.h" | 25 #include "chrome/browser/gears_integration.h" |
26 #include "chrome/browser/google_util.h" | 26 #include "chrome/browser/google_util.h" |
27 #include "chrome/browser/hung_renderer_dialog.h" | 27 #include "chrome/browser/hung_renderer_dialog.h" |
28 #include "chrome/browser/jsmessage_box_handler.h" | 28 #include "chrome/browser/jsmessage_box_handler.h" |
29 #include "chrome/browser/load_from_memory_cache_details.h" | 29 #include "chrome/browser/load_from_memory_cache_details.h" |
30 #include "chrome/browser/load_notification_details.h" | 30 #include "chrome/browser/load_notification_details.h" |
31 #include "chrome/browser/password_manager/password_manager.h" | 31 #include "chrome/browser/password_manager/password_manager.h" |
32 #include "chrome/browser/plugin_installer.h" | 32 #include "chrome/browser/plugin_installer.h" |
33 #include "chrome/browser/profile.h" | 33 #include "chrome/browser/profile.h" |
34 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 34 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 35 #include "chrome/browser/renderer_host/resource_request_details.h" |
35 #include "chrome/browser/renderer_host/web_cache_manager.h" | 36 #include "chrome/browser/renderer_host/web_cache_manager.h" |
36 #include "chrome/browser/tab_contents/infobar_delegate.h" | 37 #include "chrome/browser/tab_contents/infobar_delegate.h" |
37 #include "chrome/browser/tab_contents/interstitial_page.h" | 38 #include "chrome/browser/tab_contents/interstitial_page.h" |
38 #include "chrome/browser/tab_contents/navigation_entry.h" | 39 #include "chrome/browser/tab_contents/navigation_entry.h" |
39 #include "chrome/browser/tab_contents/provisional_load_details.h" | 40 #include "chrome/browser/tab_contents/provisional_load_details.h" |
40 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 41 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
41 #include "chrome/browser/tab_contents/tab_contents_view.h" | 42 #include "chrome/browser/tab_contents/tab_contents_view.h" |
42 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 43 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
43 #include "chrome/browser/thumbnail_store.h" | 44 #include "chrome/browser/thumbnail_store.h" |
44 #include "chrome/browser/search_engines/template_url_fetcher.h" | 45 #include "chrome/browser/search_engines/template_url_fetcher.h" |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1709 const GURL& url) { | 1710 const GURL& url) { |
1710 ProvisionalLoadDetails details(is_main_frame, | 1711 ProvisionalLoadDetails details(is_main_frame, |
1711 controller_.IsURLInPageNavigation(url), | 1712 controller_.IsURLInPageNavigation(url), |
1712 url, std::string(), false); | 1713 url, std::string(), false); |
1713 NotificationService::current()->Notify( | 1714 NotificationService::current()->Notify( |
1714 NotificationType::FRAME_PROVISIONAL_LOAD_START, | 1715 NotificationType::FRAME_PROVISIONAL_LOAD_START, |
1715 Source<NavigationController>(&controller_), | 1716 Source<NavigationController>(&controller_), |
1716 Details<ProvisionalLoadDetails>(&details)); | 1717 Details<ProvisionalLoadDetails>(&details)); |
1717 } | 1718 } |
1718 | 1719 |
| 1720 void TabContents::DidStartReceivingResourceResponse( |
| 1721 ResourceRequestDetails* details) { |
| 1722 NotificationService::current()->Notify( |
| 1723 NotificationType::RESOURCE_RESPONSE_STARTED, |
| 1724 Source<NavigationController>(&controller()), |
| 1725 Details<ResourceRequestDetails>(details)); |
| 1726 } |
| 1727 |
1719 void TabContents::DidRedirectProvisionalLoad(int32 page_id, | 1728 void TabContents::DidRedirectProvisionalLoad(int32 page_id, |
1720 const GURL& source_url, | 1729 const GURL& source_url, |
1721 const GURL& target_url) { | 1730 const GURL& target_url) { |
1722 NavigationEntry* entry; | 1731 NavigationEntry* entry; |
1723 if (page_id == -1) | 1732 if (page_id == -1) |
1724 entry = controller_.pending_entry(); | 1733 entry = controller_.pending_entry(); |
1725 else | 1734 else |
1726 entry = controller_.GetEntryWithPageID(GetSiteInstance(), page_id); | 1735 entry = controller_.GetEntryWithPageID(GetSiteInstance(), page_id); |
1727 if (!entry || entry->url() != source_url) | 1736 if (!entry || entry->url() != source_url) |
1728 return; | 1737 return; |
1729 entry->set_url(target_url); | 1738 entry->set_url(target_url); |
1730 } | 1739 } |
1731 | 1740 |
| 1741 void TabContents::DidRedirectResource(ResourceRequestDetails* details) { |
| 1742 NotificationService::current()->Notify( |
| 1743 NotificationType::RESOURCE_RECEIVED_REDIRECT, |
| 1744 Source<NavigationController>(&controller()), |
| 1745 Details<ResourceRequestDetails>(details)); |
| 1746 } |
| 1747 |
1732 void TabContents::DidLoadResourceFromMemoryCache( | 1748 void TabContents::DidLoadResourceFromMemoryCache( |
1733 const GURL& url, | 1749 const GURL& url, |
1734 const std::string& frame_origin, | 1750 const std::string& frame_origin, |
1735 const std::string& main_frame_origin, | 1751 const std::string& main_frame_origin, |
1736 const std::string& security_info) { | 1752 const std::string& security_info) { |
1737 // Send out a notification that we loaded a resource from our memory cache. | 1753 // Send out a notification that we loaded a resource from our memory cache. |
1738 int cert_id = 0, cert_status = 0, security_bits = 0; | 1754 int cert_id = 0, cert_status = 0, security_bits = 0; |
1739 SSLManager::DeserializeSecurityInfo(security_info, | 1755 SSLManager::DeserializeSecurityInfo(security_info, |
1740 &cert_id, &cert_status, | 1756 &cert_id, &cert_status, |
1741 &security_bits); | 1757 &security_bits); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2330 NavigationController::LoadCommittedDetails& committed_details = | 2346 NavigationController::LoadCommittedDetails& committed_details = |
2331 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2347 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
2332 ExpireInfoBars(committed_details); | 2348 ExpireInfoBars(committed_details); |
2333 break; | 2349 break; |
2334 } | 2350 } |
2335 | 2351 |
2336 default: | 2352 default: |
2337 NOTREACHED(); | 2353 NOTREACHED(); |
2338 } | 2354 } |
2339 } | 2355 } |
OLD | NEW |