| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/webui/settings/site_settings_handler.h" | 5 #include "chrome/browser/ui/webui/settings/site_settings_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 "cr.webUIListenerCallback", | 205 "cr.webUIListenerCallback", |
| 206 base::StringValue("contentSettingCategoryChanged"), | 206 base::StringValue("contentSettingCategoryChanged"), |
| 207 base::StringValue(site_settings::ContentSettingsTypeToGroupName( | 207 base::StringValue(site_settings::ContentSettingsTypeToGroupName( |
| 208 content_type))); | 208 content_type))); |
| 209 } else { | 209 } else { |
| 210 CallJavascriptFunction( | 210 CallJavascriptFunction( |
| 211 "cr.webUIListenerCallback", | 211 "cr.webUIListenerCallback", |
| 212 base::StringValue("contentSettingSitePermissionChanged"), | 212 base::StringValue("contentSettingSitePermissionChanged"), |
| 213 base::StringValue(site_settings::ContentSettingsTypeToGroupName( | 213 base::StringValue(site_settings::ContentSettingsTypeToGroupName( |
| 214 content_type)), | 214 content_type)), |
| 215 base::StringValue(primary_pattern.ToString())); | 215 base::StringValue(primary_pattern.ToString()), |
| 216 base::StringValue( |
| 217 secondary_pattern == ContentSettingsPattern::Wildcard() ? |
| 218 "" : secondary_pattern.ToString())); |
| 216 } | 219 } |
| 217 } | 220 } |
| 218 | 221 |
| 219 void SiteSettingsHandler::HandleFetchUsageTotal( | 222 void SiteSettingsHandler::HandleFetchUsageTotal( |
| 220 const base::ListValue* args) { | 223 const base::ListValue* args) { |
| 221 AllowJavascript(); | 224 AllowJavascript(); |
| 222 | 225 |
| 223 CHECK_EQ(1U, args->GetSize()); | 226 CHECK_EQ(1U, args->GetSize()); |
| 224 std::string host; | 227 std::string host; |
| 225 CHECK(args->GetString(0, &host)); | 228 CHECK(args->GetString(0, &host)); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 std::string pattern_string; | 431 std::string pattern_string; |
| 429 CHECK(args->GetString(1, &pattern_string)); | 432 CHECK(args->GetString(1, &pattern_string)); |
| 430 | 433 |
| 431 ContentSettingsPattern pattern = | 434 ContentSettingsPattern pattern = |
| 432 ContentSettingsPattern::FromString(pattern_string); | 435 ContentSettingsPattern::FromString(pattern_string); |
| 433 ResolveJavascriptCallback( | 436 ResolveJavascriptCallback( |
| 434 *callback_id, base::FundamentalValue(pattern.IsValid())); | 437 *callback_id, base::FundamentalValue(pattern.IsValid())); |
| 435 } | 438 } |
| 436 | 439 |
| 437 } // namespace settings | 440 } // namespace settings |
| OLD | NEW |