| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/web_contents.h" | 5 #include "chrome/browser/tab_contents/web_contents.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 entry = controller()->GetEntryWithPageID(type(), GetSiteInstance(), | 919 entry = controller()->GetEntryWithPageID(type(), GetSiteInstance(), |
| 920 page_id); | 920 page_id); |
| 921 } | 921 } |
| 922 if (!entry || entry->tab_type() != type() || entry->url() != source_url) | 922 if (!entry || entry->tab_type() != type() || entry->url() != source_url) |
| 923 return; | 923 return; |
| 924 entry->set_url(target_url); | 924 entry->set_url(target_url); |
| 925 } | 925 } |
| 926 | 926 |
| 927 void WebContents::DidLoadResourceFromMemoryCache( | 927 void WebContents::DidLoadResourceFromMemoryCache( |
| 928 const GURL& url, | 928 const GURL& url, |
| 929 const std::string& frame_origin, |
| 930 const std::string& main_frame_origin, |
| 929 const std::string& security_info) { | 931 const std::string& security_info) { |
| 930 if (!controller()) | 932 if (!controller()) |
| 931 return; | 933 return; |
| 932 | 934 |
| 933 // Send out a notification that we loaded a resource from our memory cache. | 935 // Send out a notification that we loaded a resource from our memory cache. |
| 934 int cert_id = 0, cert_status = 0, security_bits = 0; | 936 int cert_id = 0, cert_status = 0, security_bits = 0; |
| 935 SSLManager::DeserializeSecurityInfo(security_info, | 937 SSLManager::DeserializeSecurityInfo(security_info, |
| 936 &cert_id, &cert_status, | 938 &cert_id, &cert_status, |
| 937 &security_bits); | 939 &security_bits); |
| 938 LoadFromMemoryCacheDetails details(url, cert_id, cert_status); | 940 LoadFromMemoryCacheDetails details(url, frame_origin, main_frame_origin, |
| 941 cert_id, cert_status); |
| 939 | 942 |
| 940 NotificationService::current()->Notify( | 943 NotificationService::current()->Notify( |
| 941 NotificationType::LOAD_FROM_MEMORY_CACHE, | 944 NotificationType::LOAD_FROM_MEMORY_CACHE, |
| 942 Source<NavigationController>(controller()), | 945 Source<NavigationController>(controller()), |
| 943 Details<LoadFromMemoryCacheDetails>(&details)); | 946 Details<LoadFromMemoryCacheDetails>(&details)); |
| 944 } | 947 } |
| 945 | 948 |
| 946 void WebContents::DidFailProvisionalLoadWithError( | 949 void WebContents::DidFailProvisionalLoadWithError( |
| 947 RenderViewHost* render_view_host, | 950 RenderViewHost* render_view_host, |
| 948 bool is_main_frame, | 951 bool is_main_frame, |
| (...skipping 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 // The favicon url isn't valid. This means there really isn't a favicon, | 1881 // The favicon url isn't valid. This means there really isn't a favicon, |
| 1879 // or the favicon url wasn't obtained before the load started. This assumes | 1882 // or the favicon url wasn't obtained before the load started. This assumes |
| 1880 // the later. | 1883 // the later. |
| 1881 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1884 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 1882 // its url. | 1885 // its url. |
| 1883 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1886 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 1884 } | 1887 } |
| 1885 new_url->set_safe_for_autoreplace(true); | 1888 new_url->set_safe_for_autoreplace(true); |
| 1886 url_model->Add(new_url); | 1889 url_model->Add(new_url); |
| 1887 } | 1890 } |
| OLD | NEW |