| 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/ui/content_settings/content_settings_tab_helper.h" |
| 12 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 13 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 13 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" | 14 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg
ate.h" |
| 14 #include "chrome/browser/extensions/extension_tab_helper.h" | 15 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 15 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 16 #include "chrome/browser/extensions/extension_webnavigation_api.h" |
| 16 #include "chrome/browser/file_select_helper.h" | 17 #include "chrome/browser/file_select_helper.h" |
| 17 #include "chrome/browser/history/history.h" | 18 #include "chrome/browser/history/history.h" |
| 18 #include "chrome/browser/history/top_sites.h" | 19 #include "chrome/browser/history/top_sites.h" |
| 19 #include "chrome/browser/password_manager/password_manager.h" | 20 #include "chrome/browser/password_manager/password_manager.h" |
| 20 #include "chrome/browser/password_manager_delegate_impl.h" | 21 #include "chrome/browser/password_manager_delegate_impl.h" |
| 21 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 51 tab_contents_(contents) { | 52 tab_contents_(contents) { |
| 52 DCHECK(contents); | 53 DCHECK(contents); |
| 53 // Stash this in the property bag so it can be retrieved without having to | 54 // Stash this in the property bag so it can be retrieved without having to |
| 54 // go to a Browser. | 55 // go to a Browser. |
| 55 property_accessor()->SetProperty(contents->property_bag(), this); | 56 property_accessor()->SetProperty(contents->property_bag(), this); |
| 56 | 57 |
| 57 // Create the tab helpers. | 58 // Create the tab helpers. |
| 58 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); | 59 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); |
| 59 autofill_manager_.reset(new AutofillManager(contents)); | 60 autofill_manager_.reset(new AutofillManager(contents)); |
| 60 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 61 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| 62 content_settings_tab_helper_.reset(new ContentSettingsTabHelper(this)); |
| 61 download_tab_helper_.reset(new DownloadTabHelper(contents)); | 63 download_tab_helper_.reset(new DownloadTabHelper(contents)); |
| 62 extension_tab_helper_.reset(new ExtensionTabHelper(this)); | 64 extension_tab_helper_.reset(new ExtensionTabHelper(this)); |
| 63 find_tab_helper_.reset(new FindTabHelper(contents)); | 65 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 64 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents)); | 66 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(contents)); |
| 65 password_manager_.reset( | 67 password_manager_.reset( |
| 66 new PasswordManager(contents, password_manager_delegate_.get())); | 68 new PasswordManager(contents, password_manager_delegate_.get())); |
| 67 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); | 69 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); |
| 68 translate_tab_helper_.reset(new TranslateTabHelper(contents)); | 70 translate_tab_helper_.reset(new TranslateTabHelper(contents)); |
| 69 print_view_manager_.reset(new printing::PrintViewManager(contents)); | 71 print_view_manager_.reset(new printing::PrintViewManager(contents)); |
| 70 | 72 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 320 } |
| 319 | 321 |
| 320 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { | 322 void TabContentsWrapper::UpdateStarredStateForCurrentURL() { |
| 321 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); | 323 BookmarkModel* model = tab_contents()->profile()->GetBookmarkModel(); |
| 322 const bool old_state = is_starred_; | 324 const bool old_state = is_starred_; |
| 323 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); | 325 is_starred_ = (model && model->IsBookmarked(tab_contents()->GetURL())); |
| 324 | 326 |
| 325 if (is_starred_ != old_state && delegate()) | 327 if (is_starred_ != old_state && delegate()) |
| 326 delegate()->URLStarredChanged(this, is_starred_); | 328 delegate()->URLStarredChanged(this, is_starred_); |
| 327 } | 329 } |
| OLD | NEW |