| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "chrome/browser/load_notification_details.h" | 45 #include "chrome/browser/load_notification_details.h" |
| 46 #include "chrome/browser/metrics/metric_event_duration_details.h" | 46 #include "chrome/browser/metrics/metric_event_duration_details.h" |
| 47 #include "chrome/browser/metrics/user_metrics.h" | 47 #include "chrome/browser/metrics/user_metrics.h" |
| 48 #include "chrome/browser/modal_html_dialog_delegate.h" | 48 #include "chrome/browser/modal_html_dialog_delegate.h" |
| 49 #include "chrome/browser/omnibox_search_hint.h" | 49 #include "chrome/browser/omnibox_search_hint.h" |
| 50 #include "chrome/browser/pdf_unsupported_feature.h" | 50 #include "chrome/browser/pdf_unsupported_feature.h" |
| 51 #include "chrome/browser/platform_util.h" | 51 #include "chrome/browser/platform_util.h" |
| 52 #include "chrome/browser/plugin_installer_infobar_delegate.h" | 52 #include "chrome/browser/plugin_installer_infobar_delegate.h" |
| 53 #include "chrome/browser/prefs/pref_service.h" | 53 #include "chrome/browser/prefs/pref_service.h" |
| 54 #include "chrome/browser/prerender/prerender_manager.h" | 54 #include "chrome/browser/prerender/prerender_manager.h" |
| 55 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 55 #include "chrome/browser/printing/print_preview_tab_controller.h" | 56 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 56 #include "chrome/browser/printing/print_view_manager.h" | 57 #include "chrome/browser/printing/print_view_manager.h" |
| 57 #include "chrome/browser/profiles/profile.h" | 58 #include "chrome/browser/profiles/profile.h" |
| 58 #include "chrome/browser/renderer_host/render_process_host.h" | 59 #include "chrome/browser/renderer_host/render_process_host.h" |
| 59 #include "chrome/browser/renderer_host/render_view_host.h" | 60 #include "chrome/browser/renderer_host/render_view_host.h" |
| 60 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 61 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 61 #include "chrome/browser/renderer_host/resource_request_details.h" | 62 #include "chrome/browser/renderer_host/resource_request_details.h" |
| 62 #include "chrome/browser/renderer_host/site_instance.h" | 63 #include "chrome/browser/renderer_host/site_instance.h" |
| 63 #include "chrome/browser/renderer_host/web_cache_manager.h" | 64 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 64 #include "chrome/browser/renderer_preferences_util.h" | 65 #include "chrome/browser/renderer_preferences_util.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 : delegate_(NULL), | 357 : delegate_(NULL), |
| 357 ALLOW_THIS_IN_INITIALIZER_LIST(controller_( | 358 ALLOW_THIS_IN_INITIALIZER_LIST(controller_( |
| 358 this, profile, session_storage_namespace)), | 359 this, profile, session_storage_namespace)), |
| 359 ALLOW_THIS_IN_INITIALIZER_LIST(view_( | 360 ALLOW_THIS_IN_INITIALIZER_LIST(view_( |
| 360 TabContentsView::Create(this))), | 361 TabContentsView::Create(this))), |
| 361 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), | 362 ALLOW_THIS_IN_INITIALIZER_LIST(render_manager_(this, this)), |
| 362 property_bag_(), | 363 property_bag_(), |
| 363 registrar_(), | 364 registrar_(), |
| 364 ALLOW_THIS_IN_INITIALIZER_LIST(printing_( | 365 ALLOW_THIS_IN_INITIALIZER_LIST(printing_( |
| 365 new printing::PrintViewManager(*this))), | 366 new printing::PrintViewManager(*this))), |
| 367 ALLOW_THIS_IN_INITIALIZER_LIST(print_preview_( |
| 368 new printing::PrintPreviewMessageHandler(this))), |
| 366 save_package_(), | 369 save_package_(), |
| 367 autocomplete_history_manager_(), | 370 autocomplete_history_manager_(), |
| 368 autofill_manager_(), | 371 autofill_manager_(), |
| 369 plugin_installer_(), | 372 plugin_installer_(), |
| 370 bookmark_drag_(NULL), | 373 bookmark_drag_(NULL), |
| 371 ALLOW_THIS_IN_INITIALIZER_LIST(fav_icon_helper_(this)), | 374 ALLOW_THIS_IN_INITIALIZER_LIST(fav_icon_helper_(this)), |
| 372 is_loading_(false), | 375 is_loading_(false), |
| 373 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 376 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
| 374 crashed_error_code_(0), | 377 crashed_error_code_(0), |
| 375 waiting_for_response_(false), | 378 waiting_for_response_(false), |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // Set-up the showing of the omnibox search infobar if applicable. | 470 // Set-up the showing of the omnibox search infobar if applicable. |
| 468 if (OmniboxSearchHint::IsEnabled(profile)) | 471 if (OmniboxSearchHint::IsEnabled(profile)) |
| 469 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 472 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
| 470 | 473 |
| 471 autofill_manager_.reset(new AutoFillManager(this)); | 474 autofill_manager_.reset(new AutoFillManager(this)); |
| 472 AddNavigationObserver(autofill_manager_.get()); | 475 AddNavigationObserver(autofill_manager_.get()); |
| 473 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); | 476 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(this)); |
| 474 AddNavigationObserver(autocomplete_history_manager_.get()); | 477 AddNavigationObserver(autocomplete_history_manager_.get()); |
| 475 AddNavigationObserver(&fav_icon_helper_); | 478 AddNavigationObserver(&fav_icon_helper_); |
| 476 AddNavigationObserver(printing_.get()); | 479 AddNavigationObserver(printing_.get()); |
| 480 AddNavigationObserver(print_preview_.get()); |
| 477 } | 481 } |
| 478 | 482 |
| 479 TabContents::~TabContents() { | 483 TabContents::~TabContents() { |
| 480 is_being_destroyed_ = true; | 484 is_being_destroyed_ = true; |
| 481 | 485 |
| 482 // We don't want any notifications while we're running our destructor. | 486 // We don't want any notifications while we're running our destructor. |
| 483 registrar_.RemoveAll(); | 487 registrar_.RemoveAll(); |
| 484 pref_change_registrar_.RemoveAll(); | 488 pref_change_registrar_.RemoveAll(); |
| 485 | 489 |
| 486 NotifyDisconnected(); | 490 NotifyDisconnected(); |
| (...skipping 2908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3395 if (pm != NULL) { | 3399 if (pm != NULL) { |
| 3396 if (pm->MaybeUsePreloadedPage(this, url)) { | 3400 if (pm->MaybeUsePreloadedPage(this, url)) { |
| 3397 // TODO(tburkard): If the preloaded page has not finished preloading | 3401 // TODO(tburkard): If the preloaded page has not finished preloading |
| 3398 // yet, we should not do this. | 3402 // yet, we should not do this. |
| 3399 DidStopLoading(); | 3403 DidStopLoading(); |
| 3400 return true; | 3404 return true; |
| 3401 } | 3405 } |
| 3402 } | 3406 } |
| 3403 return false; | 3407 return false; |
| 3404 } | 3408 } |
| OLD | NEW |