OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 10 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 | 200 |
201 private: | 201 private: |
202 ContentSetting block_setting_; | 202 ContentSetting block_setting_; |
203 int selected_item_; | 203 int selected_item_; |
204 | 204 |
205 // Initialize the radio group by setting the appropriate labels for the | 205 // Initialize the radio group by setting the appropriate labels for the |
206 // content type and setting the default value based on the content setting. | 206 // content type and setting the default value based on the content setting. |
207 void SetRadioGroup() { | 207 void SetRadioGroup() { |
208 GURL url = tab_contents()->tab_contents()->GetURL(); | 208 GURL url = tab_contents()->tab_contents()->GetURL(); |
209 std::wstring display_host_wide; | 209 string16 display_host_utf16; |
210 net::AppendFormattedHost(url, | 210 net::AppendFormattedHost(url, |
211 UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages)), | 211 profile()->GetPrefs()->GetString(prefs::kAcceptLanguages), |
212 &display_host_wide, NULL, NULL); | 212 &display_host_utf16); |
213 std::string display_host(WideToUTF8(display_host_wide)); | 213 std::string display_host(UTF16ToUTF8(display_host_utf16)); |
214 | 214 |
215 if (display_host.empty()) | 215 if (display_host.empty()) |
216 display_host = url.spec(); | 216 display_host = url.spec(); |
217 | 217 |
218 const std::set<std::string>& resources = | 218 const std::set<std::string>& resources = |
219 bubble_content().resource_identifiers; | 219 bubble_content().resource_identifiers; |
220 | 220 |
221 RadioGroup radio_group; | 221 RadioGroup radio_group; |
222 radio_group.url = url; | 222 radio_group.url = url; |
223 | 223 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 bubble_content_.resource_identifiers.insert(resource_identifier); | 536 bubble_content_.resource_identifiers.insert(resource_identifier); |
537 } | 537 } |
538 | 538 |
539 void ContentSettingBubbleModel::Observe(NotificationType type, | 539 void ContentSettingBubbleModel::Observe(NotificationType type, |
540 const NotificationSource& source, | 540 const NotificationSource& source, |
541 const NotificationDetails& details) { | 541 const NotificationDetails& details) { |
542 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 542 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
543 DCHECK(source == Source<TabContents>(tab_contents_->tab_contents())); | 543 DCHECK(source == Source<TabContents>(tab_contents_->tab_contents())); |
544 tab_contents_ = NULL; | 544 tab_contents_ = NULL; |
545 } | 545 } |
OLD | NEW |