Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: chrome/browser/pepper_broker_infobar_delegate.cc

Issue 1312453005: Removed Profile::GetHostContentSettingsMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed patch conflict Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
9 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/plugins/plugin_finder.h" 11 #include "chrome/browser/plugins/plugin_finder.h"
11 #include "chrome/browser/plugins/plugin_metadata.h" 12 #include "chrome/browser/plugins/plugin_metadata.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
14 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
15 #include "components/content_settings/core/browser/host_content_settings_map.h" 16 #include "components/content_settings/core/browser/host_content_settings_map.h"
16 #include "components/infobars/core/infobar.h" 17 #include "components/infobars/core/infobar.h"
17 #include "components/url_formatter/url_formatter.h" 18 #include "components/url_formatter/url_formatter.h"
(...skipping 19 matching lines...) Expand all
37 // TODO(wad): Add ephemeral device ID support for broker in guest mode. 38 // TODO(wad): Add ephemeral device ID support for broker in guest mode.
38 if (profile->IsGuestSession()) { 39 if (profile->IsGuestSession()) {
39 callback.Run(false); 40 callback.Run(false);
40 return; 41 return;
41 } 42 }
42 43
43 TabSpecificContentSettings* tab_content_settings = 44 TabSpecificContentSettings* tab_content_settings =
44 TabSpecificContentSettings::FromWebContents(web_contents); 45 TabSpecificContentSettings::FromWebContents(web_contents);
45 46
46 HostContentSettingsMap* content_settings = 47 HostContentSettingsMap* content_settings =
47 profile->GetHostContentSettingsMap(); 48 HostContentSettingsMapFactory::GetForProfile(profile);
48 ContentSetting setting = 49 ContentSetting setting =
49 content_settings->GetContentSetting(url, url, 50 content_settings->GetContentSetting(url, url,
50 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, 51 CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
51 std::string()); 52 std::string());
52 53
53 if (setting == CONTENT_SETTING_ASK) { 54 if (setting == CONTENT_SETTING_ASK) {
54 content::RecordAction( 55 content::RecordAction(
55 base::UserMetricsAction("PPAPI.BrokerInfobarDisplayed")); 56 base::UserMetricsAction("PPAPI.BrokerInfobarDisplayed"));
56 InfoBarService* infobar_service = 57 InfoBarService* infobar_service =
57 InfoBarService::FromWebContents(web_contents); 58 InfoBarService::FromWebContents(web_contents);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny")); 147 base::UserMetricsAction("PPAPI.BrokerInfobarClickedDeny"));
147 callback_.Run(result); 148 callback_.Run(result);
148 callback_ = base::Callback<void(bool)>(); 149 callback_ = base::Callback<void(bool)>();
149 content_settings_->SetContentSetting( 150 content_settings_->SetContentSetting(
150 ContentSettingsPattern::FromURLNoWildcard(url_), 151 ContentSettingsPattern::FromURLNoWildcard(url_),
151 ContentSettingsPattern::Wildcard(), 152 ContentSettingsPattern::Wildcard(),
152 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, 153 CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
153 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 154 std::string(), result ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
154 tab_content_settings_->SetPepperBrokerAllowed(result); 155 tab_content_settings_->SetPepperBrokerAllowed(result);
155 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698