| 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/notifications/desktop_notification_service.h" | 5 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 notification_service_->DenyPermission(origin_); | 231 notification_service_->DenyPermission(origin_); |
| 232 action_taken_ = true; | 232 action_taken_ = true; |
| 233 return true; | 233 return true; |
| 234 } | 234 } |
| 235 | 235 |
| 236 | 236 |
| 237 // DesktopNotificationService ------------------------------------------------- | 237 // DesktopNotificationService ------------------------------------------------- |
| 238 | 238 |
| 239 // static | 239 // static |
| 240 void DesktopNotificationService::RegisterUserPrefs( | 240 void DesktopNotificationService::RegisterUserPrefs( |
| 241 PrefRegistrySyncable* registry) { | 241 user_prefs::PrefRegistrySyncable* registry) { |
| 242 #if defined(OS_CHROMEOS) || defined(ENABLE_MESSAGE_CENTER) | 242 #if defined(OS_CHROMEOS) || defined(ENABLE_MESSAGE_CENTER) |
| 243 registry->RegisterListPref(prefs::kMessageCenterDisabledExtensionIds, | 243 registry->RegisterListPref(prefs::kMessageCenterDisabledExtensionIds, |
| 244 PrefRegistrySyncable::SYNCABLE_PREF); | 244 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 245 registry->RegisterListPref(prefs::kMessageCenterDisabledSystemComponentIds, | 245 registry->RegisterListPref(prefs::kMessageCenterDisabledSystemComponentIds, |
| 246 PrefRegistrySyncable::SYNCABLE_PREF); | 246 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 247 #endif | 247 #endif |
| 248 } | 248 } |
| 249 | 249 |
| 250 // static | 250 // static |
| 251 string16 DesktopNotificationService::CreateDataUrl( | 251 string16 DesktopNotificationService::CreateDataUrl( |
| 252 const GURL& icon_url, const string16& title, const string16& body, | 252 const GURL& icon_url, const string16& title, const string16& body, |
| 253 WebTextDirection dir) { | 253 WebTextDirection dir) { |
| 254 int resource; | 254 int resource; |
| 255 std::vector<std::string> subst; | 255 std::vector<std::string> subst; |
| 256 if (icon_url.is_valid()) { | 256 if (icon_url.is_valid()) { |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 631 |
| 632 if (setting == CONTENT_SETTING_ALLOW) | 632 if (setting == CONTENT_SETTING_ALLOW) |
| 633 return WebKit::WebNotificationPresenter::PermissionAllowed; | 633 return WebKit::WebNotificationPresenter::PermissionAllowed; |
| 634 if (setting == CONTENT_SETTING_BLOCK) | 634 if (setting == CONTENT_SETTING_BLOCK) |
| 635 return WebKit::WebNotificationPresenter::PermissionDenied; | 635 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 636 if (setting == CONTENT_SETTING_ASK) | 636 if (setting == CONTENT_SETTING_ASK) |
| 637 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 637 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 638 NOTREACHED() << "Invalid notifications settings value: " << setting; | 638 NOTREACHED() << "Invalid notifications settings value: " << setting; |
| 639 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 639 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 640 } | 640 } |
| OLD | NEW |