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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/browser/tab_contents/interstitial_page.h" | 48 #include "chrome/browser/tab_contents/interstitial_page.h" |
49 #include "chrome/browser/tab_contents/navigation_entry.h" | 49 #include "chrome/browser/tab_contents/navigation_entry.h" |
50 #include "chrome/browser/tab_contents/provisional_load_details.h" | 50 #include "chrome/browser/tab_contents/provisional_load_details.h" |
51 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 51 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
52 #include "chrome/browser/tab_contents/tab_contents_view.h" | 52 #include "chrome/browser/tab_contents/tab_contents_view.h" |
53 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 53 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
54 #include "chrome/browser/thumbnail_store.h" | 54 #include "chrome/browser/thumbnail_store.h" |
55 #include "chrome/browser/search_engines/template_url_fetcher.h" | 55 #include "chrome/browser/search_engines/template_url_fetcher.h" |
56 #include "chrome/browser/search_engines/template_url_model.h" | 56 #include "chrome/browser/search_engines/template_url_model.h" |
57 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
58 #include "chrome/common/extensions/extension_action2.h" | 58 #include "chrome/common/extensions/extension_action.h" |
59 #include "chrome/common/notification_service.h" | 59 #include "chrome/common/notification_service.h" |
60 #include "chrome/common/pref_names.h" | 60 #include "chrome/common/pref_names.h" |
61 #include "chrome/common/pref_service.h" | 61 #include "chrome/common/pref_service.h" |
62 #include "chrome/common/render_messages.h" | 62 #include "chrome/common/render_messages.h" |
63 #include "chrome/common/renderer_preferences.h" | 63 #include "chrome/common/renderer_preferences.h" |
64 #include "chrome/common/url_constants.h" | 64 #include "chrome/common/url_constants.h" |
65 #include "grit/generated_resources.h" | 65 #include "grit/generated_resources.h" |
66 #include "grit/locale_settings.h" | 66 #include "grit/locale_settings.h" |
67 #include "net/base/mime_util.h" | 67 #include "net/base/mime_util.h" |
68 #include "net/base/net_errors.h" | 68 #include "net/base/net_errors.h" |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1386 | 1386 |
1387 // Clear all page and browser action state for this tab, unless this is an | 1387 // Clear all page and browser action state for this tab, unless this is an |
1388 // in-page navigation. | 1388 // in-page navigation. |
1389 url_canon::Replacements<char> replacements; | 1389 url_canon::Replacements<char> replacements; |
1390 replacements.ClearRef(); | 1390 replacements.ClearRef(); |
1391 if (params.url.ReplaceComponents(replacements) != | 1391 if (params.url.ReplaceComponents(replacements) != |
1392 params.referrer.ReplaceComponents(replacements)) { | 1392 params.referrer.ReplaceComponents(replacements)) { |
1393 ExtensionsService* service = profile()->GetExtensionsService(); | 1393 ExtensionsService* service = profile()->GetExtensionsService(); |
1394 if (service) { | 1394 if (service) { |
1395 for (size_t i = 0; i < service->extensions()->size(); ++i) { | 1395 for (size_t i = 0; i < service->extensions()->size(); ++i) { |
1396 ExtensionAction2* browser_action = | 1396 ExtensionAction* browser_action = |
1397 service->extensions()->at(i)->browser_action(); | 1397 service->extensions()->at(i)->browser_action(); |
1398 if (browser_action) { | 1398 if (browser_action) { |
1399 browser_action->ClearAllValuesForTab(controller().session_id().id()); | 1399 browser_action->ClearAllValuesForTab(controller().session_id().id()); |
1400 NotificationService::current()->Notify( | 1400 NotificationService::current()->Notify( |
1401 NotificationType::EXTENSION_BROWSER_ACTION_UPDATED, | 1401 NotificationType::EXTENSION_BROWSER_ACTION_UPDATED, |
1402 Source<ExtensionAction2>(browser_action), | 1402 Source<ExtensionAction>(browser_action), |
1403 NotificationService::NoDetails()); | 1403 NotificationService::NoDetails()); |
1404 } | 1404 } |
1405 | 1405 |
1406 ExtensionAction2* page_action = | 1406 ExtensionAction* page_action = |
1407 service->extensions()->at(i)->page_action(); | 1407 service->extensions()->at(i)->page_action(); |
1408 if (page_action) { | 1408 if (page_action) { |
1409 page_action->ClearAllValuesForTab(controller().session_id().id()); | 1409 page_action->ClearAllValuesForTab(controller().session_id().id()); |
1410 PageActionStateChanged(); | 1410 PageActionStateChanged(); |
1411 } | 1411 } |
1412 } | 1412 } |
1413 } | 1413 } |
1414 } | 1414 } |
1415 | 1415 |
1416 // Close constrained popups if necessary. | 1416 // Close constrained popups if necessary. |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2624 #endif | 2624 #endif |
2625 | 2625 |
2626 default: | 2626 default: |
2627 NOTREACHED(); | 2627 NOTREACHED(); |
2628 } | 2628 } |
2629 } | 2629 } |
2630 | 2630 |
2631 void TabContents::set_encoding(const std::string& encoding) { | 2631 void TabContents::set_encoding(const std::string& encoding) { |
2632 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); | 2632 encoding_ = CharacterEncoding::GetCanonicalEncodingNameByAliasName(encoding); |
2633 } | 2633 } |
OLD | NEW |