| 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/web_contents.h" | 5 #include "chrome/browser/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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 | 769 |
| 770 int entry_index = controller()->GetEntryIndexWithPageID( | 770 int entry_index = controller()->GetEntryIndexWithPageID( |
| 771 type(), GetSiteInstance(), page_id); | 771 type(), GetSiteInstance(), page_id); |
| 772 if (entry_index < 0) | 772 if (entry_index < 0) |
| 773 return; | 773 return; |
| 774 NavigationEntry* entry = controller()->GetEntryAtIndex(entry_index); | 774 NavigationEntry* entry = controller()->GetEntryAtIndex(entry_index); |
| 775 | 775 |
| 776 if (state == entry->content_state()) | 776 if (state == entry->content_state()) |
| 777 return; // Nothing to update. | 777 return; // Nothing to update. |
| 778 entry->set_content_state(state); | 778 entry->set_content_state(state); |
| 779 | |
| 780 // Notify everybody of the changes (only when the current page changed). | |
| 781 controller()->NotifyEntryChanged(entry, entry_index); | 779 controller()->NotifyEntryChanged(entry, entry_index); |
| 782 } | 780 } |
| 783 | 781 |
| 784 void WebContents::UpdateTitle(RenderViewHost* rvh, | 782 void WebContents::UpdateTitle(RenderViewHost* rvh, |
| 785 int32 page_id, const std::wstring& title) { | 783 int32 page_id, const std::wstring& title) { |
| 786 if (!controller()) | 784 if (!controller()) |
| 787 return; | 785 return; |
| 788 | 786 |
| 789 // If we have a title, that's a pretty good indication that we've started | 787 // If we have a title, that's a pretty good indication that we've started |
| 790 // getting useful data. | 788 // getting useful data. |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 // The favicon url isn't valid. This means there really isn't a favicon, | 1823 // The favicon url isn't valid. This means there really isn't a favicon, |
| 1826 // or the favicon url wasn't obtained before the load started. This assumes | 1824 // or the favicon url wasn't obtained before the load started. This assumes |
| 1827 // the later. | 1825 // the later. |
| 1828 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1826 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
| 1829 // its url. | 1827 // its url. |
| 1830 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1828 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
| 1831 } | 1829 } |
| 1832 new_url->set_safe_for_autoreplace(true); | 1830 new_url->set_safe_for_autoreplace(true); |
| 1833 url_model->Add(new_url); | 1831 url_model->Add(new_url); |
| 1834 } | 1832 } |
| OLD | NEW |