| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/tab_contents/tab_contents_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "chrome/browser/autocomplete_history_manager.h" | 8 #include "chrome/browser/autocomplete_history_manager.h" |
| 9 #include "chrome/browser/autofill/autofill_manager.h" | 9 #include "chrome/browser/autofill/autofill_manager.h" |
| 10 #include "chrome/browser/automation/automation_tab_helper.h" | 10 #include "chrome/browser/automation/automation_tab_helper.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 13 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 13 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
| 14 #include "chrome/browser/debugger/devtools_handler.h" | 14 #include "chrome/browser/debugger/devtools_handler.h" |
| 15 #include "chrome/browser/extensions/extension_message_handler.h" | 15 #include "chrome/browser/extensions/extension_message_handler.h" |
| 16 #include "chrome/browser/extensions/extension_tab_helper.h" | 16 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 17 #include "chrome/browser/favicon_tab_helper.h" | |
| 18 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 19 #include "chrome/browser/history/top_sites.h" | 18 #include "chrome/browser/history/top_sites.h" |
| 20 #include "chrome/browser/password_manager/password_manager.h" | 19 #include "chrome/browser/password_manager/password_manager.h" |
| 21 #include "chrome/browser/password_manager_delegate_impl.h" | 20 #include "chrome/browser/password_manager_delegate_impl.h" |
| 22 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
| 23 #include "chrome/browser/prerender/prerender_observer.h" | 22 #include "chrome/browser/prerender/prerender_observer.h" |
| 24 #include "chrome/browser/printing/print_preview_message_handler.h" | 23 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 25 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 26 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" | 25 #include "chrome/browser/tab_contents/simple_alert_infobar_delegate.h" |
| 27 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 26 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 DCHECK(contents); | 50 DCHECK(contents); |
| 52 // Stash this in the property bag so it can be retrieved without having to | 51 // Stash this in the property bag so it can be retrieved without having to |
| 53 // go to a Browser. | 52 // go to a Browser. |
| 54 property_accessor()->SetProperty(contents->property_bag(), this); | 53 property_accessor()->SetProperty(contents->property_bag(), this); |
| 55 | 54 |
| 56 // Create the tab helpers. | 55 // Create the tab helpers. |
| 57 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); | 56 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); |
| 58 autofill_manager_.reset(new AutofillManager(contents)); | 57 autofill_manager_.reset(new AutofillManager(contents)); |
| 59 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 58 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| 60 extension_tab_helper_.reset(new ExtensionTabHelper(this)); | 59 extension_tab_helper_.reset(new ExtensionTabHelper(this)); |
| 61 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | |
| 62 find_tab_helper_.reset(new FindTabHelper(contents)); | 60 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 63 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents)); | 61 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents)); |
| 64 password_manager_.reset( | 62 password_manager_.reset( |
| 65 new PasswordManager(contents, password_manager_delegate_.get())); | 63 new PasswordManager(contents, password_manager_delegate_.get())); |
| 66 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); | 64 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); |
| 67 print_view_manager_.reset(new printing::PrintViewManager(contents)); | 65 print_view_manager_.reset(new printing::PrintViewManager(contents)); |
| 68 | 66 |
| 69 // Register for notifications about URL starredness changing on any profile. | 67 // Register for notifications about URL starredness changing on any profile. |
| 70 registrar_.Add(this, NotificationType::URLS_STARRED, | 68 registrar_.Add(this, NotificationType::URLS_STARRED, |
| 71 NotificationService::AllSources()); | 69 NotificationService::AllSources()); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 290 } |
| 293 | 291 |
| 294 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { | 292 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { |
| 295 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); | 293 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); |
| 296 const bool old_state = is_starred_; | 294 const bool old_state = is_starred_; |
| 297 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); | 295 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); |
| 298 | 296 |
| 299 if (is_starred_ != old_state && delegate()) | 297 if (is_starred_ != old_state && delegate()) |
| 300 delegate()->URLStarredChanged(this, is_starred_); | 298 delegate()->URLStarredChanged(this, is_starred_); |
| 301 } | 299 } |
| OLD | NEW |