OLD | NEW |
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/content_settings/content_settings_policy_provider.h" | 5 #include "chrome/browser/content_settings/content_settings_policy_provider.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 ContentSettingsPattern::Wildcard(), | 404 ContentSettingsPattern::Wildcard(), |
405 ContentSettingsPattern::Wildcard(), | 405 ContentSettingsPattern::Wildcard(), |
406 content_type, | 406 content_type, |
407 std::string()); | 407 std::string()); |
408 } else { | 408 } else { |
409 value_map_.SetValue( | 409 value_map_.SetValue( |
410 ContentSettingsPattern::Wildcard(), | 410 ContentSettingsPattern::Wildcard(), |
411 ContentSettingsPattern::Wildcard(), | 411 ContentSettingsPattern::Wildcard(), |
412 content_type, | 412 content_type, |
413 std::string(), | 413 std::string(), |
414 Value::CreateIntegerValue(setting)); | 414 base::Value::CreateIntegerValue(setting)); |
415 } | 415 } |
416 } | 416 } |
417 | 417 |
418 | 418 |
419 void PolicyProvider::ReadManagedContentSettings(bool overwrite) { | 419 void PolicyProvider::ReadManagedContentSettings(bool overwrite) { |
420 base::AutoLock auto_lock(lock_); | 420 base::AutoLock auto_lock(lock_); |
421 if (overwrite) | 421 if (overwrite) |
422 value_map_.clear(); | 422 value_map_.clear(); |
423 GetContentSettingsFromPreferences(&value_map_); | 423 GetContentSettingsFromPreferences(&value_map_); |
424 GetAutoSelectCertificateSettingsFromPreferences(&value_map_); | 424 GetAutoSelectCertificateSettingsFromPreferences(&value_map_); |
425 } | 425 } |
426 | 426 |
427 // Since the PolicyProvider is a read only content settings provider, all | 427 // Since the PolicyProvider is a read only content settings provider, all |
428 // methodes of the ProviderInterface that set or delete any settings do nothing. | 428 // methodes of the ProviderInterface that set or delete any settings do nothing. |
429 bool PolicyProvider::SetWebsiteSetting( | 429 bool PolicyProvider::SetWebsiteSetting( |
430 const ContentSettingsPattern& primary_pattern, | 430 const ContentSettingsPattern& primary_pattern, |
431 const ContentSettingsPattern& secondary_pattern, | 431 const ContentSettingsPattern& secondary_pattern, |
432 ContentSettingsType content_type, | 432 ContentSettingsType content_type, |
433 const ResourceIdentifier& resource_identifier, | 433 const ResourceIdentifier& resource_identifier, |
434 Value* value) { | 434 base::Value* value) { |
435 return false; | 435 return false; |
436 } | 436 } |
437 | 437 |
438 void PolicyProvider::ClearAllContentSettingsRules( | 438 void PolicyProvider::ClearAllContentSettingsRules( |
439 ContentSettingsType content_type) { | 439 ContentSettingsType content_type) { |
440 } | 440 } |
441 | 441 |
442 void PolicyProvider::ShutdownOnUIThread() { | 442 void PolicyProvider::ShutdownOnUIThread() { |
443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 443 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
444 RemoveAllObservers(); | 444 RemoveAllObservers(); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 ReadManagedDefaultSettings(); | 485 ReadManagedDefaultSettings(); |
486 } | 486 } |
487 | 487 |
488 NotifyObservers(ContentSettingsPattern(), | 488 NotifyObservers(ContentSettingsPattern(), |
489 ContentSettingsPattern(), | 489 ContentSettingsPattern(), |
490 CONTENT_SETTINGS_TYPE_DEFAULT, | 490 CONTENT_SETTINGS_TYPE_DEFAULT, |
491 std::string()); | 491 std::string()); |
492 } | 492 } |
493 | 493 |
494 } // namespace content_settings | 494 } // namespace content_settings |
OLD | NEW |