OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/geolocation/geolocation_settings_state.h" | 5 #include "chrome/browser/geolocation/geolocation_settings_state.h" |
6 | 6 |
7 #include "base/string_piece.h" | 7 #include "base/string_piece.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 9 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/tab_contents/navigation_entry.h" | 12 #include "chrome/browser/tab_contents/navigation_entry.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "net/base/net_util.h" | 14 #include "net/base/net_util.h" |
15 | 15 |
16 GeolocationSettingsState::GeolocationSettingsState(Profile* profile) | 16 GeolocationSettingsState::GeolocationSettingsState(Profile* profile) |
17 : profile_(profile) { | 17 : profile_(profile) { |
18 } | 18 } |
19 | 19 |
20 GeolocationSettingsState::~GeolocationSettingsState() { | 20 GeolocationSettingsState::~GeolocationSettingsState() { |
21 } | 21 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 std::string GeolocationSettingsState::GURLToFormattedHost( | 96 std::string GeolocationSettingsState::GURLToFormattedHost( |
97 const GURL& url) const { | 97 const GURL& url) const { |
98 std::wstring display_host_wide; | 98 std::wstring display_host_wide; |
99 net::AppendFormattedHost( | 99 net::AppendFormattedHost( |
100 url, UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)), | 100 url, UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)), |
101 &display_host_wide, NULL, NULL); | 101 &display_host_wide, NULL, NULL); |
102 return WideToUTF8(display_host_wide); | 102 return WideToUTF8(display_host_wide); |
103 } | 103 } |
OLD | NEW |