Commit 6e40caad authored by Tim Brown's avatar Tim Brown Committed by Commit Bot

Always use libappindicator if available

This is in effect a temporary fix to always use libappindicator (when
available, but we have deb/rpm dependency on the lib, so it should
always be available), whilst I fix the dependency issue we have on the
build bots which would allow me to add a hard dependency and clean up
the code.

Bug: 799144, 797332 , 419673
Change-Id: Id64a452029b00ec8d86f0d35d319bebcfd8bf99e
Reviewed-on: https://chromium-review.googlesource.com/939732Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Tim Brown <timbrown@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539852}
parent 6e3fb99a
......@@ -82,34 +82,12 @@ app_indicator_set_icon_full_func app_indicator_set_icon_full = nullptr;
app_indicator_set_icon_theme_path_func app_indicator_set_icon_theme_path =
nullptr;
bool ShouldUseLibAppIndicator() {
// Only use libappindicator where it is needed to support dbus based status
// icons. In particular, libappindicator does not support a click action.
std::unique_ptr<base::Environment> env(base::Environment::Create());
switch (base::nix::GetDesktopEnvironment(env.get())) {
case base::nix::DESKTOP_ENVIRONMENT_KDE4:
case base::nix::DESKTOP_ENVIRONMENT_KDE5:
case base::nix::DESKTOP_ENVIRONMENT_PANTHEON:
case base::nix::DESKTOP_ENVIRONMENT_UNITY:
return true;
case base::nix::DESKTOP_ENVIRONMENT_CINNAMON:
case base::nix::DESKTOP_ENVIRONMENT_GNOME:
case base::nix::DESKTOP_ENVIRONMENT_KDE3:
case base::nix::DESKTOP_ENVIRONMENT_OTHER:
case base::nix::DESKTOP_ENVIRONMENT_XFCE:
return false;
}
}
void EnsureMethodsLoaded() {
if (g_attempted_load)
return;
g_attempted_load = true;
if (!ShouldUseLibAppIndicator())
return;
void* indicator_lib = nullptr;
// These include guards might be unnecessary, but let's keep them as a
......
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