| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "ui/base/layout.h" | 45 #include "ui/base/layout.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 | 47 |
| 48 #if defined(USE_ASH) | 48 #if defined(USE_ASH) |
| 49 #include "ash/ash_switches.h" | 49 #include "ash/ash_switches.h" |
| 50 #include "base/command_line.h" | 50 #include "base/command_line.h" |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 bool IsAshNotifyEnabled() { | 54 bool IsAshNotifyEnabled() { |
| 55 return !CommandLine::ForCurrentProcess()->HasSwitch( | 55 return CommandLine::ForCurrentProcess()->HasSwitch(ash::switches::kAshNotify); |
| 56 ash::switches::kAshNotifyDisabled); | |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace | 58 } // namespace |
| 60 #endif | 59 #endif |
| 61 | 60 |
| 62 using content::BrowserThread; | 61 using content::BrowserThread; |
| 63 using content::RenderViewHost; | 62 using content::RenderViewHost; |
| 64 using content::WebContents; | 63 using content::WebContents; |
| 65 using WebKit::WebNotificationPresenter; | 64 using WebKit::WebNotificationPresenter; |
| 66 using WebKit::WebTextDirection; | 65 using WebKit::WebTextDirection; |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 522 |
| 524 if (setting == CONTENT_SETTING_ALLOW) | 523 if (setting == CONTENT_SETTING_ALLOW) |
| 525 return WebKit::WebNotificationPresenter::PermissionAllowed; | 524 return WebKit::WebNotificationPresenter::PermissionAllowed; |
| 526 if (setting == CONTENT_SETTING_BLOCK) | 525 if (setting == CONTENT_SETTING_BLOCK) |
| 527 return WebKit::WebNotificationPresenter::PermissionDenied; | 526 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 528 if (setting == CONTENT_SETTING_ASK) | 527 if (setting == CONTENT_SETTING_ASK) |
| 529 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 528 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 530 NOTREACHED() << "Invalid notifications settings value: " << setting; | 529 NOTREACHED() << "Invalid notifications settings value: " << setting; |
| 531 return WebKit::WebNotificationPresenter::PermissionNotAllowed; | 530 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 532 } | 531 } |
| OLD | NEW |