| 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/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 registrar_.Add(this, NotificationType::URLS_STARRED, | 277 registrar_.Add(this, NotificationType::URLS_STARRED, |
| 278 NotificationService::AllSources()); | 278 NotificationService::AllSources()); |
| 279 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, | 279 registrar_.Add(this, NotificationType::BOOKMARK_MODEL_LOADED, |
| 280 NotificationService::AllSources()); | 280 NotificationService::AllSources()); |
| 281 registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, | 281 registrar_.Add(this, NotificationType::RENDER_WIDGET_HOST_DESTROYED, |
| 282 NotificationService::AllSources()); | 282 NotificationService::AllSources()); |
| 283 | 283 |
| 284 // Keep a global copy of the previous search string (if any). | 284 // Keep a global copy of the previous search string (if any). |
| 285 static string16 global_last_search = string16(); | 285 static string16 global_last_search = string16(); |
| 286 last_search_prepopulate_text_ = &global_last_search; | 286 last_search_prepopulate_text_ = &global_last_search; |
| 287 |
| 288 view_->InitRendererPrefs(&renderer_preferences_); |
| 287 } | 289 } |
| 288 | 290 |
| 289 TabContents::~TabContents() { | 291 TabContents::~TabContents() { |
| 290 is_being_destroyed_ = true; | 292 is_being_destroyed_ = true; |
| 291 | 293 |
| 292 // We don't want any notifications while we're runnign our destructor. | 294 // We don't want any notifications while we're runnign our destructor. |
| 293 registrar_.RemoveAll(); | 295 registrar_.RemoveAll(); |
| 294 | 296 |
| 295 // Unregister the notifications of all observed prefs change. | 297 // Unregister the notifications of all observed prefs change. |
| 296 PrefService* prefs = profile()->GetPrefs(); | 298 PrefService* prefs = profile()->GetPrefs(); |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1706 return &fav_icon_helper_; | 1708 return &fav_icon_helper_; |
| 1707 } | 1709 } |
| 1708 | 1710 |
| 1709 RenderViewHostDelegate::Autofill* TabContents::GetAutofillDelegate() { | 1711 RenderViewHostDelegate::Autofill* TabContents::GetAutofillDelegate() { |
| 1710 if (autofill_manager_.get() == NULL) | 1712 if (autofill_manager_.get() == NULL) |
| 1711 autofill_manager_.reset(new AutofillManager(this)); | 1713 autofill_manager_.reset(new AutofillManager(this)); |
| 1712 return autofill_manager_.get(); | 1714 return autofill_manager_.get(); |
| 1713 } | 1715 } |
| 1714 | 1716 |
| 1715 RendererPreferences TabContents::GetRendererPrefs() const { | 1717 RendererPreferences TabContents::GetRendererPrefs() const { |
| 1716 if (delegate()) | 1718 return renderer_preferences_; |
| 1717 return delegate()->GetRendererPrefs(); | |
| 1718 else | |
| 1719 return RendererPreferences(); | |
| 1720 } | 1719 } |
| 1721 | 1720 |
| 1722 TabContents* TabContents::GetAsTabContents() { | 1721 TabContents* TabContents::GetAsTabContents() { |
| 1723 return this; | 1722 return this; |
| 1724 } | 1723 } |
| 1725 | 1724 |
| 1726 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { | 1725 void TabContents::RenderViewCreated(RenderViewHost* render_view_host) { |
| 1727 NotificationService::current()->Notify( | 1726 NotificationService::current()->Notify( |
| 1728 NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, | 1727 NotificationType::RENDER_VIEW_HOST_CREATED_FOR_TAB, |
| 1729 Source<TabContents>(this), | 1728 Source<TabContents>(this), |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2351 NavigationController::LoadCommittedDetails& committed_details = | 2350 NavigationController::LoadCommittedDetails& committed_details = |
| 2352 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2351 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2353 ExpireInfoBars(committed_details); | 2352 ExpireInfoBars(committed_details); |
| 2354 break; | 2353 break; |
| 2355 } | 2354 } |
| 2356 | 2355 |
| 2357 default: | 2356 default: |
| 2358 NOTREACHED(); | 2357 NOTREACHED(); |
| 2359 } | 2358 } |
| 2360 } | 2359 } |
| OLD | NEW |