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/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/file_version_info.h" | 10 #include "base/file_version_info.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "chrome/browser/modal_html_dialog_delegate.h" | 38 #include "chrome/browser/modal_html_dialog_delegate.h" |
39 #include "chrome/browser/omnibox_search_hint.h" | 39 #include "chrome/browser/omnibox_search_hint.h" |
40 #include "chrome/browser/password_manager/password_manager.h" | 40 #include "chrome/browser/password_manager/password_manager.h" |
41 #include "chrome/browser/plugin_installer.h" | 41 #include "chrome/browser/plugin_installer.h" |
42 #include "chrome/browser/profile.h" | 42 #include "chrome/browser/profile.h" |
43 #include "chrome/browser/renderer_host/render_process_host.h" | 43 #include "chrome/browser/renderer_host/render_process_host.h" |
44 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 44 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
45 #include "chrome/browser/renderer_host/resource_request_details.h" | 45 #include "chrome/browser/renderer_host/resource_request_details.h" |
46 #include "chrome/browser/renderer_host/site_instance.h" | 46 #include "chrome/browser/renderer_host/site_instance.h" |
47 #include "chrome/browser/renderer_host/web_cache_manager.h" | 47 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 48 #include "chrome/browser/renderer_preferences_util.h" |
48 #include "chrome/browser/tab_contents/infobar_delegate.h" | 49 #include "chrome/browser/tab_contents/infobar_delegate.h" |
49 #include "chrome/browser/tab_contents/interstitial_page.h" | 50 #include "chrome/browser/tab_contents/interstitial_page.h" |
50 #include "chrome/browser/tab_contents/navigation_entry.h" | 51 #include "chrome/browser/tab_contents/navigation_entry.h" |
51 #include "chrome/browser/tab_contents/provisional_load_details.h" | 52 #include "chrome/browser/tab_contents/provisional_load_details.h" |
52 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 53 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
53 #include "chrome/browser/tab_contents/tab_contents_view.h" | 54 #include "chrome/browser/tab_contents/tab_contents_view.h" |
54 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 55 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
55 #include "chrome/browser/thumbnail_store.h" | 56 #include "chrome/browser/thumbnail_store.h" |
56 #include "chrome/browser/search_engines/template_url_fetcher.h" | 57 #include "chrome/browser/search_engines/template_url_fetcher.h" |
57 #include "chrome/browser/search_engines/template_url_model.h" | 58 #include "chrome/browser/search_engines/template_url_model.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 capturing_contents_(false), | 253 capturing_contents_(false), |
253 is_being_destroyed_(false), | 254 is_being_destroyed_(false), |
254 notify_disconnection_(false), | 255 notify_disconnection_(false), |
255 history_requests_(), | 256 history_requests_(), |
256 #if defined(OS_WIN) | 257 #if defined(OS_WIN) |
257 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), | 258 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), |
258 #endif | 259 #endif |
259 last_javascript_message_dismissal_(), | 260 last_javascript_message_dismissal_(), |
260 suppress_javascript_messages_(false), | 261 suppress_javascript_messages_(false), |
261 is_showing_before_unload_dialog_(false), | 262 is_showing_before_unload_dialog_(false), |
262 renderer_preferences_(platform_util::GetInitedRendererPreferences()), | 263 renderer_preferences_( |
| 264 renderer_preferences_util::GetInitedRendererPreferences(profile)), |
263 opener_dom_ui_type_(DOMUIFactory::kNoDOMUI) { | 265 opener_dom_ui_type_(DOMUIFactory::kNoDOMUI) { |
264 #if defined(OS_CHROMEOS) | 266 #if defined(OS_CHROMEOS) |
265 // Make sure the thumbnailer is started before starting the render manager. | 267 // Make sure the thumbnailer is started before starting the render manager. |
266 // The thumbnailer will want to listen for RVH creations, one of which will | 268 // The thumbnailer will want to listen for RVH creations, one of which will |
267 // happen in RVHManager::Init. | 269 // happen in RVHManager::Init. |
268 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); | 270 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); |
269 if (generator) | 271 if (generator) |
270 generator->StartThumbnailing(); | 272 generator->StartThumbnailing(); |
271 #endif | 273 #endif |
272 | 274 |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1875 form_field_history_manager_.reset(new FormFieldHistoryManager(this)); | 1877 form_field_history_manager_.reset(new FormFieldHistoryManager(this)); |
1876 return form_field_history_manager_.get(); | 1878 return form_field_history_manager_.get(); |
1877 } | 1879 } |
1878 | 1880 |
1879 RenderViewHostDelegate::AutoFill* TabContents::GetAutoFillDelegate() { | 1881 RenderViewHostDelegate::AutoFill* TabContents::GetAutoFillDelegate() { |
1880 if (autofill_manager_.get() == NULL) | 1882 if (autofill_manager_.get() == NULL) |
1881 autofill_manager_.reset(new AutoFillManager(this)); | 1883 autofill_manager_.reset(new AutoFillManager(this)); |
1882 return autofill_manager_.get(); | 1884 return autofill_manager_.get(); |
1883 } | 1885 } |
1884 | 1886 |
1885 RendererPreferences TabContents::GetRendererPrefs() const { | 1887 RendererPreferences TabContents::GetRendererPrefs(Profile* profile) const { |
1886 return renderer_preferences_; | 1888 return renderer_preferences_; |
1887 } | 1889 } |
1888 | 1890 |
1889 TabContents* TabContents::GetAsTabContents() { | 1891 TabContents* TabContents::GetAsTabContents() { |
1890 return this; | 1892 return this; |
1891 } | 1893 } |
1892 | 1894 |
1893 void TabContents::AddBlockedNotice(const GURL& url, const string16& reason) { | 1895 void TabContents::AddBlockedNotice(const GURL& url, const string16& reason) { |
1894 CreateBlockedPopupContainerIfNecessary(); | 1896 CreateBlockedPopupContainerIfNecessary(); |
1895 blocked_popups_->AddBlockedNotice(url, reason); | 1897 blocked_popups_->AddBlockedNotice(url, reason); |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2638 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, success, prompt); | 2640 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, success, prompt); |
2639 } | 2641 } |
2640 | 2642 |
2641 void TabContents::SetSuppressMessageBoxes(bool suppress_message_boxes) { | 2643 void TabContents::SetSuppressMessageBoxes(bool suppress_message_boxes) { |
2642 set_suppress_javascript_messages(suppress_message_boxes); | 2644 set_suppress_javascript_messages(suppress_message_boxes); |
2643 } | 2645 } |
2644 | 2646 |
2645 void TabContents::set_encoding(const std::string& encoding) { | 2647 void TabContents::set_encoding(const std::string& encoding) { |
2646 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 2648 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
2647 } | 2649 } |
OLD | NEW |