| 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/pepper_broker_infobar_delegate.h" | 5 #include "chrome/browser/pepper_broker_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 9 #include "chrome/browser/infobars/infobar_service.h" | 9 #include "chrome/browser/infobars/infobar_service.h" |
| 10 #include "chrome/browser/plugins/plugin_finder.h" | 10 #include "chrome/browser/plugins/plugin_finder.h" |
| 11 #include "chrome/browser/plugins/plugin_metadata.h" | 11 #include "chrome/browser/plugins/plugin_metadata.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/grit/generated_resources.h" | 13 #include "chrome/grit/generated_resources.h" |
| 14 #include "chrome/grit/theme_resources.h" |
| 14 #include "components/content_settings/core/browser/host_content_settings_map.h" | 15 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 15 #include "components/infobars/core/infobar.h" | 16 #include "components/infobars/core/infobar.h" |
| 17 #include "components/strings/grit/components_strings.h" |
| 16 #include "components/url_formatter/elide_url.h" | 18 #include "components/url_formatter/elide_url.h" |
| 17 #include "content/public/browser/page_navigator.h" | 19 #include "content/public/browser/page_navigator.h" |
| 18 #include "content/public/browser/plugin_service.h" | 20 #include "content/public/browser/plugin_service.h" |
| 19 #include "content/public/browser/user_metrics.h" | 21 #include "content/public/browser/user_metrics.h" |
| 20 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
| 21 #include "content/public/common/referrer.h" | 23 #include "content/public/common/referrer.h" |
| 22 #include "content/public/common/webplugininfo.h" | 24 #include "content/public/common/webplugininfo.h" |
| 23 #include "grit/components_strings.h" | |
| 24 #include "grit/theme_resources.h" | |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 | 26 |
| 27 | 27 |
| 28 // static | 28 // static |
| 29 void PepperBrokerInfoBarDelegate::Create( | 29 void PepperBrokerInfoBarDelegate::Create( |
| 30 content::WebContents* web_contents, | 30 content::WebContents* web_contents, |
| 31 const GURL& url, | 31 const GURL& url, |
| 32 const base::FilePath& plugin_path, | 32 const base::FilePath& plugin_path, |
| 33 const base::Callback<void(bool)>& callback) { | 33 const base::Callback<void(bool)>& callback) { |
| 34 Profile* profile = | 34 Profile* profile = |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 content::RecordAction(result ? | 138 content::RecordAction(result ? |
| 139 base::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") : | 139 base::UserMetricsAction("PPAPI.BrokerInfobarClickedAllow") : |
| 140 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); | 140 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); |
| 141 callback_.Run(result); | 141 callback_.Run(result); |
| 142 callback_ = base::Callback<void(bool)>(); | 142 callback_ = base::Callback<void(bool)>(); |
| 143 content_settings_->SetContentSettingDefaultScope( | 143 content_settings_->SetContentSettingDefaultScope( |
| 144 url_, GURL(), CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string(), | 144 url_, GURL(), CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string(), |
| 145 result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); | 145 result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); |
| 146 tab_content_settings_->SetPepperBrokerAllowed(result); | 146 tab_content_settings_->SetPepperBrokerAllowed(result); |
| 147 } | 147 } |
| OLD | NEW |