#include "base/prefs/pref_service.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
+#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "net/base/net_util.h"
-ContentSettingsUsagesState::ContentSettingsUsagesState(Profile* profile,
- ContentSettingsType type)
- : profile_(profile),
+ContentSettingsUsagesState::ContentSettingsUsagesState(
+ HostContentSettingsMap* host_content_settings_map,
+ PrefService* pref_service,
+ ContentSettingsType type)
+ : host_content_settings_map_(host_content_settings_map),
+ pref_service_(pref_service),
type_(type) {
}
DCHECK(tab_state_flags);
DCHECK(embedder_url_.is_valid());
ContentSetting default_setting =
- profile_->GetHostContentSettingsMap()->GetDefaultContentSetting(
- type_, NULL);
+ host_content_settings_map_->GetDefaultContentSetting(type_, NULL);
std::set<std::string> formatted_hosts;
std::set<std::string> repeated_formatted_hosts;
}
const ContentSetting saved_setting =
- profile_->GetHostContentSettingsMap()->GetContentSetting(
- i->first, embedder_url_, type_, std::string());
+ host_content_settings_map_->GetContentSetting(i->first, embedder_url_,
+ type_, std::string());
if (saved_setting != default_setting)
*tab_state_flags |= TABSTATE_HAS_EXCEPTION;
if (saved_setting != i->second)
std::string ContentSettingsUsagesState::GURLToFormattedHost(
const GURL& url) const {
base::string16 display_host;
- net::AppendFormattedHost(url,
- profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), &display_host);
+ net::AppendFormattedHost(
+ url, pref_service_->GetString(prefs::kAcceptLanguages), &display_host);
return base::UTF16ToUTF8(display_host);
}