| 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/notifications/notifications_prefs_cache.h" | 5 #include "chrome/browser/notifications/notifications_prefs_cache.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebNotificationPresenter.h" |
| 12 | 12 |
| 13 NotificationsPrefsCache::NotificationsPrefsCache() | 13 NotificationsPrefsCache::NotificationsPrefsCache() |
| 14 : default_content_setting_(CONTENT_SETTING_DEFAULT), | 14 : default_content_setting_(CONTENT_SETTING_DEFAULT), |
| 15 is_initialized_(false) { | 15 is_initialized_(false) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void NotificationsPrefsCache::CacheAllowedOrigin( | 18 void NotificationsPrefsCache::CacheAllowedOrigin( |
| 19 const GURL& origin) { | 19 const GURL& origin) { |
| 20 CheckThreadAccess(); | 20 CheckThreadAccess(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 return denied_origins_.find(origin) != denied_origins_.end(); | 91 return denied_origins_.find(origin) != denied_origins_.end(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void NotificationsPrefsCache::CheckThreadAccess() { | 94 void NotificationsPrefsCache::CheckThreadAccess() { |
| 95 if (is_initialized_) { | 95 if (is_initialized_) { |
| 96 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 96 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 97 } else { | 97 } else { |
| 98 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 98 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); |
| 99 } | 99 } |
| 100 } | 100 } |
| OLD | NEW |