| 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" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/time.h" | 13 #include "base/time.h" |
| 14 #include "chrome/browser/autofill_manager.h" | 14 #include "chrome/browser/autofill_manager.h" |
| 15 #include "chrome/browser/blocked_popup_container.h" | 15 #include "chrome/browser/blocked_popup_container.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 18 #include "chrome/browser/cert_store.h" | 18 #include "chrome/browser/cert_store.h" |
| 19 #include "chrome/browser/character_encoding.h" | 19 #include "chrome/browser/character_encoding.h" |
| 20 #include "chrome/browser/debugger/devtools_manager.h" | 20 #include "chrome/browser/debugger/devtools_manager.h" |
| 21 #include "chrome/browser/dom_operation_notification_details.h" | 21 #include "chrome/browser/dom_operation_notification_details.h" |
| 22 #include "chrome/browser/dom_ui/dom_ui.h" | 22 #include "chrome/browser/dom_ui/dom_ui.h" |
| 23 #include "chrome/browser/dom_ui/dom_ui_factory.h" | 23 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| 24 #include "chrome/browser/download/download_item_model.h" | 24 #include "chrome/browser/download/download_item_model.h" |
| 25 #include "chrome/browser/download/download_manager.h" | 25 #include "chrome/browser/download/download_manager.h" |
| 26 #include "chrome/browser/download/download_request_manager.h" | 26 #include "chrome/browser/download/download_request_manager.h" |
| 27 #include "chrome/browser/external_protocol_handler.h" |
| 27 #include "chrome/browser/favicon_service.h" | 28 #include "chrome/browser/favicon_service.h" |
| 28 #include "chrome/browser/gears_integration.h" | 29 #include "chrome/browser/gears_integration.h" |
| 29 #include "chrome/browser/google_util.h" | 30 #include "chrome/browser/google_util.h" |
| 30 #include "chrome/browser/hung_renderer_dialog.h" | 31 #include "chrome/browser/hung_renderer_dialog.h" |
| 31 #include "chrome/browser/jsmessage_box_handler.h" | 32 #include "chrome/browser/jsmessage_box_handler.h" |
| 32 #include "chrome/browser/load_from_memory_cache_details.h" | 33 #include "chrome/browser/load_from_memory_cache_details.h" |
| 33 #include "chrome/browser/load_notification_details.h" | 34 #include "chrome/browser/load_notification_details.h" |
| 34 #include "chrome/browser/modal_html_dialog_delegate.h" | 35 #include "chrome/browser/modal_html_dialog_delegate.h" |
| 35 #include "chrome/browser/omnibox_search_hint.h" | 36 #include "chrome/browser/omnibox_search_hint.h" |
| 36 #include "chrome/browser/password_manager/password_manager.h" | 37 #include "chrome/browser/password_manager/password_manager.h" |
| (...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 } | 1601 } |
| 1601 new_url->set_safe_for_autoreplace(true); | 1602 new_url->set_safe_for_autoreplace(true); |
| 1602 url_model->Add(new_url); | 1603 url_model->Add(new_url); |
| 1603 } | 1604 } |
| 1604 | 1605 |
| 1605 void TabContents::OnUserGesture() { | 1606 void TabContents::OnUserGesture() { |
| 1606 // See comment in RenderViewHostDelegate::OnUserGesture as to why we do this. | 1607 // See comment in RenderViewHostDelegate::OnUserGesture as to why we do this. |
| 1607 DownloadRequestManager* drm = g_browser_process->download_request_manager(); | 1608 DownloadRequestManager* drm = g_browser_process->download_request_manager(); |
| 1608 if (drm) | 1609 if (drm) |
| 1609 drm->OnUserGesture(this); | 1610 drm->OnUserGesture(this); |
| 1611 ExternalProtocolHandler::OnUserGesture(); |
| 1610 controller_.OnUserGesture(); | 1612 controller_.OnUserGesture(); |
| 1611 } | 1613 } |
| 1612 | 1614 |
| 1613 void TabContents::OnFindReply(int request_id, | 1615 void TabContents::OnFindReply(int request_id, |
| 1614 int number_of_matches, | 1616 int number_of_matches, |
| 1615 const gfx::Rect& selection_rect, | 1617 const gfx::Rect& selection_rect, |
| 1616 int active_match_ordinal, | 1618 int active_match_ordinal, |
| 1617 bool final_update) { | 1619 bool final_update) { |
| 1618 // Ignore responses for requests that have been aborted. | 1620 // Ignore responses for requests that have been aborted. |
| 1619 if (find_op_aborted_) | 1621 if (find_op_aborted_) |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2524 | 2526 |
| 2525 default: | 2527 default: |
| 2526 NOTREACHED(); | 2528 NOTREACHED(); |
| 2527 } | 2529 } |
| 2528 } | 2530 } |
| 2529 | 2531 |
| 2530 void TabContents::set_encoding(const std::string& encoding) { | 2532 void TabContents::set_encoding(const std::string& encoding) { |
| 2531 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 2533 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
| 2532 } | 2534 } |
| 2533 | 2535 |
| OLD | NEW |