| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 #include "chrome/browser/tab_contents/provisional_load_details.h" | 51 #include "chrome/browser/tab_contents/provisional_load_details.h" |
| 52 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 52 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 53 #include "chrome/browser/tab_contents/tab_contents_view.h" | 53 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 54 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 54 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 55 #include "chrome/browser/thumbnail_store.h" | 55 #include "chrome/browser/thumbnail_store.h" |
| 56 #include "chrome/browser/search_engines/template_url_fetcher.h" | 56 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 57 #include "chrome/browser/search_engines/template_url_model.h" | 57 #include "chrome/browser/search_engines/template_url_model.h" |
| 58 #include "chrome/common/chrome_switches.h" | 58 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/extensions/extension_action.h" | 59 #include "chrome/common/extensions/extension_action.h" |
| 60 #include "chrome/common/notification_service.h" | 60 #include "chrome/common/notification_service.h" |
| 61 #include "chrome/common/platform_util.h" |
| 61 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 62 #include "chrome/common/pref_service.h" | 63 #include "chrome/common/pref_service.h" |
| 63 #include "chrome/common/render_messages.h" | 64 #include "chrome/common/render_messages.h" |
| 64 #include "chrome/common/renderer_preferences.h" | 65 #include "chrome/common/renderer_preferences.h" |
| 65 #include "chrome/common/url_constants.h" | 66 #include "chrome/common/url_constants.h" |
| 66 #include "grit/generated_resources.h" | 67 #include "grit/generated_resources.h" |
| 67 #include "grit/locale_settings.h" | 68 #include "grit/locale_settings.h" |
| 68 #include "net/base/mime_util.h" | 69 #include "net/base/mime_util.h" |
| 69 #include "net/base/net_errors.h" | 70 #include "net/base/net_errors.h" |
| 70 #include "net/base/net_util.h" | 71 #include "net/base/net_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 capturing_contents_(false), | 252 capturing_contents_(false), |
| 252 is_being_destroyed_(false), | 253 is_being_destroyed_(false), |
| 253 notify_disconnection_(false), | 254 notify_disconnection_(false), |
| 254 history_requests_(), | 255 history_requests_(), |
| 255 #if defined(OS_WIN) | 256 #if defined(OS_WIN) |
| 256 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), | 257 message_box_active_(CreateEvent(NULL, TRUE, FALSE, NULL)), |
| 257 #endif | 258 #endif |
| 258 last_javascript_message_dismissal_(), | 259 last_javascript_message_dismissal_(), |
| 259 suppress_javascript_messages_(false), | 260 suppress_javascript_messages_(false), |
| 260 is_showing_before_unload_dialog_(false), | 261 is_showing_before_unload_dialog_(false), |
| 262 renderer_preferences_(platform_util::GetInitedRendererPreferences()), |
| 261 opener_dom_ui_type_(DOMUIFactory::kNoDOMUI) { | 263 opener_dom_ui_type_(DOMUIFactory::kNoDOMUI) { |
| 262 #if defined(OS_CHROMEOS) | 264 #if defined(OS_CHROMEOS) |
| 263 // Make sure the thumbnailer is started before starting the render manager. | 265 // Make sure the thumbnailer is started before starting the render manager. |
| 264 // The thumbnailer will want to listen for RVH creations, one of which will | 266 // The thumbnailer will want to listen for RVH creations, one of which will |
| 265 // happen in RVHManager::Init. | 267 // happen in RVHManager::Init. |
| 266 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); | 268 ThumbnailGenerator* generator = g_browser_process->GetThumbnailGenerator(); |
| 267 if (generator) | 269 if (generator) |
| 268 generator->StartThumbnailing(); | 270 generator->StartThumbnailing(); |
| 269 #endif | 271 #endif |
| 270 | 272 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 294 NotificationService::AllSources()); | 296 NotificationService::AllSources()); |
| 295 #endif | 297 #endif |
| 296 | 298 |
| 297 // Keep a global copy of the previous search string (if any). | 299 // Keep a global copy of the previous search string (if any). |
| 298 static string16 global_last_search = string16(); | 300 static string16 global_last_search = string16(); |
| 299 last_search_prepopulate_text_ = &global_last_search; | 301 last_search_prepopulate_text_ = &global_last_search; |
| 300 | 302 |
| 301 // Set-up the showing of the omnibox search infobar if applicable. | 303 // Set-up the showing of the omnibox search infobar if applicable. |
| 302 if (OmniboxSearchHint::IsEnabled(profile)) | 304 if (OmniboxSearchHint::IsEnabled(profile)) |
| 303 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 305 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
| 304 | |
| 305 view_->InitRendererPrefs(&renderer_preferences_); | |
| 306 } | 306 } |
| 307 | 307 |
| 308 TabContents::~TabContents() { | 308 TabContents::~TabContents() { |
| 309 is_being_destroyed_ = true; | 309 is_being_destroyed_ = true; |
| 310 | 310 |
| 311 // We don't want any notifications while we're running our destructor. | 311 // We don't want any notifications while we're running our destructor. |
| 312 registrar_.RemoveAll(); | 312 registrar_.RemoveAll(); |
| 313 | 313 |
| 314 // Unregister the notifications of all observed prefs change. | 314 // Unregister the notifications of all observed prefs change. |
| 315 PrefService* prefs = profile()->GetPrefs(); | 315 PrefService* prefs = profile()->GetPrefs(); |
| (...skipping 2314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, success, prompt); | 2630 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, success, prompt); |
| 2631 } | 2631 } |
| 2632 | 2632 |
| 2633 void TabContents::SetSuppressMessageBoxes(bool suppress_message_boxes) { | 2633 void TabContents::SetSuppressMessageBoxes(bool suppress_message_boxes) { |
| 2634 set_suppress_javascript_messages(suppress_message_boxes); | 2634 set_suppress_javascript_messages(suppress_message_boxes); |
| 2635 } | 2635 } |
| 2636 | 2636 |
| 2637 void TabContents::set_encoding(const std::string& encoding) { | 2637 void TabContents::set_encoding(const std::string& encoding) { |
| 2638 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 2638 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
| 2639 } | 2639 } |
| OLD | NEW |