Commit 73bae9d5 authored by joone.hur@intel.com's avatar joone.hur@intel.com

Fix build by adding a guard to exclude glib code.

Chromium started to use glib to parse .desktop file:
https://codereview.chromium.org/7000018

However, use_glib is not added when use_ozone is defined,
which causes a build error.
https://codereview.chromium.org/249583003

BUG=none

Review URL: https://codereview.chromium.org/276673002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269644 0039d316-1c4b-4281-b951-d872f2087c98
parent 46c80dce
...@@ -5,7 +5,11 @@ ...@@ -5,7 +5,11 @@
#include "chrome/browser/shell_integration_linux.h" #include "chrome/browser/shell_integration_linux.h"
#include <fcntl.h> #include <fcntl.h>
#if defined(USE_GLIB)
#include <glib.h> #include <glib.h>
#endif
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -444,6 +448,7 @@ ShellIntegration::DefaultWebClientState GetIsDefaultWebClient( ...@@ -444,6 +448,7 @@ ShellIntegration::DefaultWebClientState GetIsDefaultWebClient(
// Get the value of NoDisplay from the [Desktop Entry] section of a .desktop // Get the value of NoDisplay from the [Desktop Entry] section of a .desktop
// file, given in |shortcut_contents|. If the key is not found, returns false. // file, given in |shortcut_contents|. If the key is not found, returns false.
bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) { bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) {
#if defined(USE_GLIB)
// An empty file causes a crash with glib <= 2.32, so special case here. // An empty file causes a crash with glib <= 2.32, so special case here.
if (shortcut_contents.empty()) if (shortcut_contents.empty())
return false; return false;
...@@ -472,6 +477,10 @@ bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) { ...@@ -472,6 +477,10 @@ bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) {
g_key_file_free(key_file); g_key_file_free(key_file);
return nodisplay; return nodisplay;
#else
NOTIMPLEMENTED();
return false;
#endif
} }
// Gets the path to the Chrome executable or wrapper script. // Gets the path to the Chrome executable or wrapper script.
...@@ -778,6 +787,7 @@ std::string GetDesktopFileContentsForCommand( ...@@ -778,6 +787,7 @@ std::string GetDesktopFileContentsForCommand(
const std::string& icon_name, const std::string& icon_name,
const std::string& categories, const std::string& categories,
bool no_display) { bool no_display) {
#if defined(USE_GLIB)
// Although not required by the spec, Nautilus on Ubuntu Karmic creates its // Although not required by the spec, Nautilus on Ubuntu Karmic creates its
// launchers with an xdg-open shebang. Follow that convention. // launchers with an xdg-open shebang. Follow that convention.
std::string output_buffer = std::string(kXdgOpenShebang) + "\n"; std::string output_buffer = std::string(kXdgOpenShebang) + "\n";
...@@ -844,10 +854,15 @@ std::string GetDesktopFileContentsForCommand( ...@@ -844,10 +854,15 @@ std::string GetDesktopFileContentsForCommand(
g_key_file_free(key_file); g_key_file_free(key_file);
return output_buffer; return output_buffer;
#else
NOTIMPLEMENTED();
return std::string("");
#endif
} }
std::string GetDirectoryFileContents(const base::string16& title, std::string GetDirectoryFileContents(const base::string16& title,
const std::string& icon_name) { const std::string& icon_name) {
#if defined(USE_GLIB)
// See http://standards.freedesktop.org/desktop-entry-spec/latest/ // See http://standards.freedesktop.org/desktop-entry-spec/latest/
GKeyFile* key_file = g_key_file_new(); GKeyFile* key_file = g_key_file_new();
...@@ -879,6 +894,10 @@ std::string GetDirectoryFileContents(const base::string16& title, ...@@ -879,6 +894,10 @@ std::string GetDirectoryFileContents(const base::string16& title,
g_key_file_free(key_file); g_key_file_free(key_file);
return output_buffer; return output_buffer;
#else
NOTIMPLEMENTED();
return std::string("");
#endif
} }
bool CreateDesktopShortcut( bool CreateDesktopShortcut(
......
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