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 24 matching lines...) Expand all Loading... |
35 #include "chrome/common/l10n_util.h" | 35 #include "chrome/common/l10n_util.h" |
36 #include "chrome/common/notification_service.h" | 36 #include "chrome/common/notification_service.h" |
37 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
38 #include "chrome/common/pref_service.h" | 38 #include "chrome/common/pref_service.h" |
39 #include "chrome/common/render_messages.h" | 39 #include "chrome/common/render_messages.h" |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "grit/locale_settings.h" | 41 #include "grit/locale_settings.h" |
42 #include "net/base/mime_util.h" | 42 #include "net/base/mime_util.h" |
43 #include "net/base/net_errors.h" | 43 #include "net/base/net_errors.h" |
44 #include "net/base/registry_controlled_domain.h" | 44 #include "net/base/registry_controlled_domain.h" |
| 45 #include "webkit/glue/feed.h" |
45 #include "webkit/glue/webkit_glue.h" | 46 #include "webkit/glue/webkit_glue.h" |
46 | 47 |
47 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
48 // TODO(port): fill these in as we flesh out the implementation of this class | 49 // TODO(port): fill these in as we flesh out the implementation of this class |
49 #include "chrome/browser/cache_manager_host.h" | 50 #include "chrome/browser/cache_manager_host.h" |
50 #include "chrome/browser/download/download_request_manager.h" | 51 #include "chrome/browser/download/download_request_manager.h" |
51 #include "chrome/browser/modal_html_dialog_delegate.h" | 52 #include "chrome/browser/modal_html_dialog_delegate.h" |
52 #include "chrome/browser/plugin_service.h" | 53 #include "chrome/browser/plugin_service.h" |
53 #include "chrome/browser/printing/print_job.h" | 54 #include "chrome/browser/printing/print_job.h" |
54 #include "chrome/browser/search_engines/template_url_fetcher.h" | 55 #include "chrome/browser/search_engines/template_url_fetcher.h" |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 GetSiteInstance(), | 801 GetSiteInstance(), |
801 page_id); | 802 page_id); |
802 if (!entry || !UpdateTitleForEntry(entry, title)) | 803 if (!entry || !UpdateTitleForEntry(entry, title)) |
803 return; | 804 return; |
804 | 805 |
805 // Broadcast notifications when the UI should be updated. | 806 // Broadcast notifications when the UI should be updated. |
806 if (entry == controller()->GetEntryAtOffset(0)) | 807 if (entry == controller()->GetEntryAtOffset(0)) |
807 NotifyNavigationStateChanged(INVALIDATE_TITLE); | 808 NotifyNavigationStateChanged(INVALIDATE_TITLE); |
808 } | 809 } |
809 | 810 |
| 811 void WebContents::UpdateFeedList( |
| 812 RenderViewHost* rvh, const ViewHostMsg_UpdateFeedList_Params& params) { |
| 813 if (!controller()) |
| 814 return; |
| 815 |
| 816 // We might have an old RenderViewHost sending messages, and we should ignore |
| 817 // those messages. |
| 818 if (rvh != render_view_host()) |
| 819 return; |
| 820 |
| 821 NavigationEntry* entry = controller()->GetEntryWithPageID(type(), |
| 822 GetSiteInstance(), |
| 823 params.page_id); |
| 824 if (!entry) |
| 825 return; |
| 826 |
| 827 entry->set_feedlist(params.feedlist); |
| 828 |
| 829 // Broadcast notifications when the UI should be updated. |
| 830 if (entry == controller()->GetEntryAtOffset(0)) |
| 831 NotifyNavigationStateChanged(INVALIDATE_FEEDLIST); |
| 832 } |
| 833 |
810 void WebContents::UpdateEncoding(RenderViewHost* render_view_host, | 834 void WebContents::UpdateEncoding(RenderViewHost* render_view_host, |
811 const std::wstring& encoding) { | 835 const std::wstring& encoding) { |
812 set_encoding(encoding); | 836 set_encoding(encoding); |
813 } | 837 } |
814 | 838 |
815 void WebContents::UpdateTargetURL(int32 page_id, const GURL& url) { | 839 void WebContents::UpdateTargetURL(int32 page_id, const GURL& url) { |
816 if (delegate()) | 840 if (delegate()) |
817 delegate()->UpdateTargetURL(this, url); | 841 delegate()->UpdateTargetURL(this, url); |
818 } | 842 } |
819 | 843 |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 // The favicon url isn't valid. This means there really isn't a favicon, | 1878 // The favicon url isn't valid. This means there really isn't a favicon, |
1855 // or the favicon url wasn't obtained before the load started. This assumes | 1879 // or the favicon url wasn't obtained before the load started. This assumes |
1856 // the later. | 1880 // the later. |
1857 // TODO(sky): Need a way to set the favicon that doesn't involve generating | 1881 // TODO(sky): Need a way to set the favicon that doesn't involve generating |
1858 // its url. | 1882 // its url. |
1859 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); | 1883 new_url->SetFavIconURL(TemplateURL::GenerateFaviconURL(params.referrer)); |
1860 } | 1884 } |
1861 new_url->set_safe_for_autoreplace(true); | 1885 new_url->set_safe_for_autoreplace(true); |
1862 url_model->Add(new_url); | 1886 url_model->Add(new_url); |
1863 } | 1887 } |
OLD | NEW |