| 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/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 25 matching lines...) Expand all Loading... |
| 36 #include "grit/browser_resources.h" | 36 #include "grit/browser_resources.h" |
| 37 #include "grit/chromium_strings.h" | 37 #include "grit/chromium_strings.h" |
| 38 #include "grit/generated_resources.h" | 38 #include "grit/generated_resources.h" |
| 39 #include "grit/theme_resources_standard.h" | 39 #include "grit/theme_resources_standard.h" |
| 40 #include "net/base/escape.h" | 40 #include "net/base/escape.h" |
| 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 42 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
| 43 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
| 44 | 44 |
| 45 using content::BrowserThread; | 45 using content::BrowserThread; |
| 46 using content::RenderViewHost; |
| 46 using content::WebContents; | 47 using content::WebContents; |
| 47 using WebKit::WebNotificationPresenter; | 48 using WebKit::WebNotificationPresenter; |
| 48 using WebKit::WebTextDirection; | 49 using WebKit::WebTextDirection; |
| 49 using WebKit::WebSecurityOrigin; | 50 using WebKit::WebSecurityOrigin; |
| 50 | 51 |
| 51 const ContentSetting kDefaultSetting = CONTENT_SETTING_ASK; | 52 const ContentSetting kDefaultSetting = CONTENT_SETTING_ASK; |
| 52 | 53 |
| 53 // NotificationPermissionInfoBarDelegate -------------------------------------- | 54 // NotificationPermissionInfoBarDelegate -------------------------------------- |
| 54 | 55 |
| 55 // The delegate for the infobar shown when an origin requests notification | 56 // The delegate for the infobar shown when an origin requests notification |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 | 451 |
| 451 if (setting == CONTENT_SETTING_ALLOW) | 452 if (setting == CONTENT_SETTING_ALLOW) |
| 452 return WebKit::WebNotificationPresenter::PermissionAllowed; | 453 return WebKit::WebNotificationPresenter::PermissionAllowed; |
| 453 if (setting == CONTENT_SETTING_BLOCK) | 454 if (setting == CONTENT_SETTING_BLOCK) |
| 454 return WebKit::WebNotificationPresenter::PermissionDenied; | 455 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 455 if (setting == CONTENT_SETTING_ASK) | 456 if (setting == CONTENT_SETTING_ASK) |
| 456 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 457 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 457 NOTREACHED() << "Invalid notifications settings value: " << setting; | 458 NOTREACHED() << "Invalid notifications settings value: " << setting; |
| 458 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 459 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 459 } | 460 } |
| OLD | NEW |