Commit 9b5dbf76 authored by dewittj@chromium.org's avatar dewittj@chromium.org

Rearrange gyp files for Message Center

In order to facilitate the move to MessageCenterNotificationManager, we
need to be able to determine when message_center.gyp is being included
in the build.  This change defines ENABLE_MESSAGE_CENTER which can be
used for conditional compilation.

r=stevenjb@chromium.org
TBR=ben@chromium.org

BUG=168605

Review URL: https://chromiumcodereview.appspot.com/11791004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175876 0039d316-1c4b-4281-b951-d872f2087c98
parent 09e4f4c6
......@@ -135,11 +135,14 @@
'enable_touch_ui%': 1,
}],
# Enable App Launcher only on ChromeOS and Windows for now.
# Enable App Launcher & Message Center only on ChromeOS and Windows
# for now.
['use_ash==1 or OS=="win"', {
'enable_app_list%': 1,
'enable_message_center%': 1,
}, {
'enable_app_list%': 0,
'enable_message_center%': 0,
}],
['use_aura==1 or (OS!="win" and OS!="mac" and OS!="ios" and OS!="android")', {
......@@ -165,6 +168,7 @@
'enable_touch_ui%': '<(enable_touch_ui)',
'android_build_type%': '<(android_build_type)',
'enable_app_list%': '<(enable_app_list)',
'enable_message_center%': '<(enable_message_center)',
'use_default_render_theme%': '<(use_default_render_theme)',
'buildtype%': '<(buildtype)',
......@@ -716,6 +720,7 @@
'use_system_libjpeg%': '<(use_system_libjpeg)',
'android_build_type%': '<(android_build_type)',
'enable_app_list%': '<(enable_app_list)',
'enable_message_center%': '<(enable_message_center)',
'use_default_render_theme%': '<(use_default_render_theme)',
'enable_settings_app%': '<(enable_settings_app)',
'use_official_google_api_keys%': '<(use_official_google_api_keys)',
......@@ -1920,6 +1925,9 @@
['enable_app_list==1', {
'defines': ['ENABLE_APP_LIST=1'],
}],
['enable_message_center==1', {
'defines': ['ENABLE_MESSAGE_CENTER=1'],
}],
['enable_settings_app==1', {
'defines': ['ENABLE_SETTINGS_APP=1'],
}],
......
......@@ -6,12 +6,15 @@
#include "base/command_line.h"
#include "chrome/browser/notifications/balloon_notification_ui_manager.h"
#include "chrome/browser/notifications/message_center_notification_manager.h"
#include "chrome/common/chrome_switches.h"
#if defined(ENABLE_MESSAGE_CENTER)
#include "chrome/browser/notifications/message_center_notification_manager.h"
#endif
// static
bool NotificationUIManager::DelegatesToMessageCenter() {
#if defined(OS_WIN) || defined(OS_CHROMEOS)
#if defined(ENABLE_MESSAGE_CENTER)
return CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableRichNotifications);
#else
......@@ -22,14 +25,14 @@ bool NotificationUIManager::DelegatesToMessageCenter() {
#if !defined(OS_MACOSX)
// static
NotificationUIManager* NotificationUIManager::Create(PrefService* local_state) {
if (DelegatesToMessageCenter()) {
#if defined(ENABLE_MESSAGE_CENTER)
if (DelegatesToMessageCenter())
return new MessageCenterNotificationManager();
} else {
BalloonNotificationUIManager* balloon_manager =
new BalloonNotificationUIManager(local_state);
balloon_manager->SetBalloonCollection(BalloonCollection::Create());
return balloon_manager;
}
#endif
BalloonNotificationUIManager* balloon_manager =
new BalloonNotificationUIManager(local_state);
balloon_manager->SetBalloonCollection(BalloonCollection::Create());
return balloon_manager;
}
#endif
......@@ -2980,6 +2980,16 @@
'../ui/app_list/app_list.gyp:app_list',
]
}],
['enable_message_center==1', {
'dependencies': [
'../ui/message_center/message_center.gyp:message_center',
],
}, { # enable_message_center==0
'sources!': [
'browser/notifications/message_center_notification_manager.cc',
'browser/notifications/message_center_notification_manager.h',
],
}],
],
'target_conditions': [
# Need 'target_conditions' to override default filename_rules to include
......
......@@ -2351,12 +2351,6 @@
'dependencies': [
'../ash/ash.gyp:ash',
'../ash/ash_strings.gyp:ash_strings',
'../ui/message_center/message_center.gyp:message_center',
],
}],
['OS=="win"', {
'dependencies': [
'../ui/message_center/message_center.gyp:message_center'
],
}],
['use_aura==1 and use_ash==0 and OS=="linux"', {
......@@ -2809,6 +2803,11 @@
['exclude', '^browser/ui/app_list/'],
]
}],
['enable_message_center==1', {
'dependencies': [
'../ui/message_center/message_center.gyp:message_center',
],
}],
],
},
],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment