| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/content_settings/content_setting_bubble_model.h" | 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/metrics/user_metrics.h" |
| 12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
| 15 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 16 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" | 17 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" |
| 17 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 18 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 19 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 19 #include "chrome/browser/content_settings/mixed_content_settings_tab_helper.h" | 20 #include "chrome/browser/content_settings/mixed_content_settings_tab_helper.h" |
| 20 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 21 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 22 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 #include "components/prefs/pref_service.h" | 45 #include "components/prefs/pref_service.h" |
| 45 #include "components/rappor/public/rappor_utils.h" | 46 #include "components/rappor/public/rappor_utils.h" |
| 46 #include "components/rappor/rappor_service_impl.h" | 47 #include "components/rappor/rappor_service_impl.h" |
| 47 #include "components/strings/grit/components_strings.h" | 48 #include "components/strings/grit/components_strings.h" |
| 48 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" | 49 #include "components/subresource_filter/content/browser/content_subresource_filt
er_driver_factory.h" |
| 49 #include "components/url_formatter/elide_url.h" | 50 #include "components/url_formatter/elide_url.h" |
| 50 #include "content/public/browser/notification_service.h" | 51 #include "content/public/browser/notification_service.h" |
| 51 #include "content/public/browser/render_frame_host.h" | 52 #include "content/public/browser/render_frame_host.h" |
| 52 #include "content/public/browser/render_process_host.h" | 53 #include "content/public/browser/render_process_host.h" |
| 53 #include "content/public/browser/render_view_host.h" | 54 #include "content/public/browser/render_view_host.h" |
| 54 #include "content/public/browser/user_metrics.h" | |
| 55 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 56 #include "content/public/browser/web_contents_delegate.h" | 56 #include "content/public/browser/web_contents_delegate.h" |
| 57 #include "content/public/common/origin_util.h" | 57 #include "content/public/common/origin_util.h" |
| 58 #include "ppapi/features/features.h" | 58 #include "ppapi/features/features.h" |
| 59 #include "services/service_manager/public/cpp/interface_provider.h" | 59 #include "services/service_manager/public/cpp/interface_provider.h" |
| 60 #include "ui/base/l10n/l10n_util.h" | 60 #include "ui/base/l10n/l10n_util.h" |
| 61 #include "ui/base/resource/resource_bundle.h" | 61 #include "ui/base/resource/resource_bundle.h" |
| 62 #include "ui/resources/grit/ui_resources.h" | 62 #include "ui/resources/grit/ui_resources.h" |
| 63 | 63 |
| 64 using base::UserMetricsAction; | 64 using base::UserMetricsAction; |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 512 |
| 513 void ContentSettingPluginBubbleModel::OnLearnMoreLinkClicked() { | 513 void ContentSettingPluginBubbleModel::OnLearnMoreLinkClicked() { |
| 514 if (delegate()) | 514 if (delegate()) |
| 515 delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_PLUGINS); | 515 delegate()->ShowLearnMorePage(CONTENT_SETTINGS_TYPE_PLUGINS); |
| 516 | 516 |
| 517 content_settings::RecordPluginsAction( | 517 content_settings::RecordPluginsAction( |
| 518 content_settings::PLUGINS_ACTION_CLICKED_LEARN_MORE); | 518 content_settings::PLUGINS_ACTION_CLICKED_LEARN_MORE); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { | 521 void ContentSettingPluginBubbleModel::OnCustomLinkClicked() { |
| 522 content::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); | 522 base::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); |
| 523 content_settings::RecordPluginsAction( | 523 content_settings::RecordPluginsAction( |
| 524 content_settings::PLUGINS_ACTION_CLICKED_RUN_ALL_PLUGINS_THIS_TIME); | 524 content_settings::PLUGINS_ACTION_CLICKED_RUN_ALL_PLUGINS_THIS_TIME); |
| 525 | 525 |
| 526 RunPluginsOnPage(); | 526 RunPluginsOnPage(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 void ContentSettingPluginBubbleModel::RunPluginsOnPage() { | 529 void ContentSettingPluginBubbleModel::RunPluginsOnPage() { |
| 530 // Web contents can be NULL if the tab was closed while the plugins | 530 // Web contents can be NULL if the tab was closed while the plugins |
| 531 // settings bubble is visible. | 531 // settings bubble is visible. |
| 532 if (!web_contents()) | 532 if (!web_contents()) |
| (...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1590 | 1590 |
| 1591 ContentSettingSubresourceFilterBubbleModel* | 1591 ContentSettingSubresourceFilterBubbleModel* |
| 1592 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | 1592 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { |
| 1593 return nullptr; | 1593 return nullptr; |
| 1594 } | 1594 } |
| 1595 | 1595 |
| 1596 ContentSettingDownloadsBubbleModel* | 1596 ContentSettingDownloadsBubbleModel* |
| 1597 ContentSettingBubbleModel::AsDownloadsBubbleModel() { | 1597 ContentSettingBubbleModel::AsDownloadsBubbleModel() { |
| 1598 return nullptr; | 1598 return nullptr; |
| 1599 } | 1599 } |
| OLD | NEW |