Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: chrome/browser/notifications/notification_ui_manager.cc

Issue 247943003: Allow compiling Android with notifications=1, add stubbed UI manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/notification_ui_manager.h" 5 #include "chrome/browser/notifications/notification_ui_manager.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/notifications/message_center_notification_manager.h" 9 #include "chrome/browser/notifications/message_center_notification_manager.h"
dewittj 2014/04/22 19:03:18 do you need to exclude these lines if Android is d
Peter Beverloo 2014/04/22 19:24:10 It would be cleaner, but since it'll add a lot of
stevenjb 2014/04/22 20:26:39 I think this is fine as-is, but if we do change it
Peter Beverloo 2014/04/29 15:46:19 Good idea, thanks! Done.
10 #include "chrome/browser/notifications/message_center_settings_controller.h" 10 #include "chrome/browser/notifications/message_center_settings_controller.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/profiles/profile_info_cache.h" 12 #include "chrome/browser/profiles/profile_info_cache.h"
13 #include "chrome/browser/profiles/profile_manager.h" 13 #include "chrome/browser/profiles/profile_manager.h"
14 #include "ui/message_center/message_center_util.h" 14 #include "ui/message_center/message_center_util.h"
15 15
16 #if defined(OS_ANDROID)
17 #include "chrome/browser/notifications/notification_ui_manager_android.h"
18 #endif
19
16 // static 20 // static
17 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) { 21 NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
22 #if defined(OS_ANDROID)
23 // Chrome for Android defers to the Android framework for displaying
24 // notifications, and thus doesn't use the message center.
25 return new NotificationUIManagerAndroid();
26 #else
18 ProfileInfoCache* profile_info_cache = 27 ProfileInfoCache* profile_info_cache =
19 &g_browser_process->profile_manager()->GetProfileInfoCache(); 28 &g_browser_process->profile_manager()->GetProfileInfoCache();
20 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider( 29 scoped_ptr<message_center::NotifierSettingsProvider> settings_provider(
21 new MessageCenterSettingsController(profile_info_cache)); 30 new MessageCenterSettingsController(profile_info_cache));
22 return new MessageCenterNotificationManager( 31 return new MessageCenterNotificationManager(
23 g_browser_process->message_center(), 32 g_browser_process->message_center(),
24 local_state, 33 local_state,
25 settings_provider.Pass()); 34 settings_provider.Pass());
35 #endif
26 } 36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698