OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/notifications/balloon_host.h" |
| 6 #include "chrome/browser/notifications/desktop_notification_service.h" |
| 7 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 8 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 9 #include "chrome/browser/notifications/notifications_prefs_cache.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 13 #include "chrome/common/pref_names.h" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen
ter.h" |
| 15 |
| 16 ////////////////////////// NotificationUIManager ////////////////////////////// |
| 17 |
| 18 // static |
| 19 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { |
| 20 return new NotificationUIManager(local_state); |
| 21 } |
| 22 |
| 23 NotificationUIManager::NotificationUIManager(PrefService* local_state) { |
| 24 } |
| 25 |
| 26 NotificationUIManager::~NotificationUIManager() { |
| 27 } |
| 28 |
| 29 // static |
| 30 void NotificationUIManager::RegisterPrefs(PrefService* prefs) { |
| 31 } |
| 32 |
| 33 void NotificationUIManager::Observe(NotificationType type, |
| 34 const NotificationSource& source, |
| 35 const NotificationDetails& details) { |
| 36 } |
| 37 |
| 38 void NotificationUIManager::Add(const Notification& notification, |
| 39 Profile* profile) { |
| 40 } |
| 41 |
| 42 bool NotificationUIManager::CancelById(const std::string& notification_id) { |
| 43 return true; |
| 44 } |
| 45 |
| 46 bool NotificationUIManager::CancelAllBySourceOrigin(const GURL& source_origin) { |
| 47 return true; |
| 48 } |
| 49 |
| 50 void NotificationUIManager::OnBalloonSpaceChanged() { |
| 51 } |
| 52 |
| 53 /////////////////////////// DesktopNotificationService //////////////////////// |
| 54 |
| 55 DesktopNotificationService::DesktopNotificationService(Profile* profile, |
| 56 NotificationUIManager* ui_manager) { |
| 57 } |
| 58 |
| 59 DesktopNotificationService::~DesktopNotificationService() { |
| 60 } |
| 61 |
| 62 void DesktopNotificationService::RequestPermission( |
| 63 const GURL& origin, int process_id, int route_id, int callback_context, |
| 64 TabContents* tab) { |
| 65 } |
| 66 |
| 67 void DesktopNotificationService::RegisterUserPrefs(PrefService* user_prefs) { |
| 68 content_settings::NotificationProvider::RegisterUserPrefs(user_prefs); |
| 69 } |
| 70 |
| 71 void DesktopNotificationService::GrantPermission(const GURL& origin) { |
| 72 } |
| 73 |
| 74 void DesktopNotificationService::DenyPermission(const GURL& origin) { |
| 75 } |
| 76 |
| 77 void DesktopNotificationService::Observe(NotificationType type, |
| 78 const NotificationSource& source, |
| 79 const NotificationDetails& details) { |
| 80 } |
| 81 |
| 82 ContentSetting DesktopNotificationService::GetDefaultContentSetting() { |
| 83 return CONTENT_SETTING_DEFAULT; |
| 84 } |
| 85 |
| 86 void DesktopNotificationService::SetDefaultContentSetting( |
| 87 ContentSetting setting) { |
| 88 } |
| 89 |
| 90 bool DesktopNotificationService::IsDefaultContentSettingManaged() const { |
| 91 return false; |
| 92 } |
| 93 |
| 94 std::vector<GURL> DesktopNotificationService::GetAllowedOrigins() { |
| 95 return std::vector<GURL>(); |
| 96 } |
| 97 |
| 98 std::vector<GURL> DesktopNotificationService::GetBlockedOrigins() { |
| 99 return std::vector<GURL>(); |
| 100 } |
| 101 |
| 102 void DesktopNotificationService::ResetAllowedOrigin(const GURL& origin) { |
| 103 } |
| 104 |
| 105 void DesktopNotificationService::ResetBlockedOrigin(const GURL& origin) { |
| 106 } |
| 107 |
| 108 // static |
| 109 void DesktopNotificationService::ShowBalloon(GURL origin_url, |
| 110 GURL icon_url, |
| 111 const string16& title, |
| 112 const string16& message, |
| 113 NotificationDelegate* delegate, |
| 114 Profile* profile) { |
| 115 } |
| 116 |
| 117 // static |
| 118 int DesktopNotificationService::HasPermission(Profile* profile, |
| 119 const GURL& origin) { |
| 120 return WebKit::WebNotificationPresenter::PermissionNotAllowed; |
| 121 } |
| 122 |
| 123 // static |
| 124 DesktopNotificationService* DesktopNotificationServiceFactory::GetForProfile( |
| 125 Profile* profile) { |
| 126 return NULL; |
| 127 } |
| 128 |
| 129 ///////////////////// DesktopNotificationServiceFactory /////////////////////// |
| 130 |
| 131 // static |
| 132 DesktopNotificationServiceFactory* DesktopNotificationServiceFactory:: |
| 133 GetInstance() { |
| 134 return Singleton<DesktopNotificationServiceFactory>::get(); |
| 135 } |
| 136 |
| 137 DesktopNotificationServiceFactory::DesktopNotificationServiceFactory() |
| 138 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { |
| 139 } |
| 140 |
| 141 DesktopNotificationServiceFactory::~DesktopNotificationServiceFactory() { |
| 142 } |
| 143 |
| 144 ProfileKeyedService* DesktopNotificationServiceFactory::BuildServiceInstanceFor( |
| 145 Profile* profile) const { |
| 146 return NULL; |
| 147 } |
| 148 |
| 149 bool DesktopNotificationServiceFactory::ServiceHasOwnInstanceInIncognito() { |
| 150 return true; |
| 151 } |
| 152 |
| 153 /////////////////////////////////// BalloonHost /////////////////////////////// |
| 154 |
| 155 // static |
| 156 bool BalloonHost::IsRenderViewReady() const { |
| 157 return true; |
| 158 } |
| 159 |
| 160 //////////////////////////// NotificationsPrefsCache ////////////////////////// |
| 161 |
| 162 // static |
| 163 void NotificationsPrefsCache::ListValueToGurlVector( |
| 164 const ListValue& origin_list, |
| 165 std::vector<GURL>* origin_vector) { |
| 166 } |
OLD | NEW |