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

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 276673002: Fix build by adding a guard to exclude glib code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_linux.cc
diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc
index b2b111e989b3ba906f913ea6b644f21ba3a40be3..dd7d752a7ebb6e845607a033f03a16e6ef529371 100644
--- a/chrome/browser/shell_integration_linux.cc
+++ b/chrome/browser/shell_integration_linux.cc
@@ -5,7 +5,11 @@
#include "chrome/browser/shell_integration_linux.h"
#include <fcntl.h>
+
+#if defined(USE_GLIB)
#include <glib.h>
+#endif
+
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -444,6 +448,10 @@ ShellIntegration::DefaultWebClientState GetIsDefaultWebClient(
// 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.
bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) {
+#if defined(USE_OZONE)
Elliot Glaysher 2014/05/08 19:28:34 Because you're checking USE_GLIB in the header at
+ NOTIMPLEMENTED();
+ return false;
+#else
// An empty file causes a crash with glib <= 2.32, so special case here.
if (shortcut_contents.empty())
return false;
@@ -472,6 +480,7 @@ bool GetNoDisplayFromDesktopFile(const std::string& shortcut_contents) {
g_key_file_free(key_file);
return nodisplay;
+#endif
}
// Gets the path to the Chrome executable or wrapper script.
@@ -778,6 +787,10 @@ std::string GetDesktopFileContentsForCommand(
const std::string& icon_name,
const std::string& categories,
bool no_display) {
+#if defined(USE_OZONE)
+ NOTIMPLEMENTED();
+ return std::string("");
+#else
// Although not required by the spec, Nautilus on Ubuntu Karmic creates its
// launchers with an xdg-open shebang. Follow that convention.
std::string output_buffer = std::string(kXdgOpenShebang) + "\n";
@@ -844,10 +857,15 @@ std::string GetDesktopFileContentsForCommand(
g_key_file_free(key_file);
return output_buffer;
+#endif
}
std::string GetDirectoryFileContents(const base::string16& title,
const std::string& icon_name) {
+#if defined(USE_OZONE)
+ NOTIMPLEMENTED();
+ return std::string("");
+#else
// See http://standards.freedesktop.org/desktop-entry-spec/latest/
GKeyFile* key_file = g_key_file_new();
@@ -879,6 +897,7 @@ std::string GetDirectoryFileContents(const base::string16& title,
g_key_file_free(key_file);
return output_buffer;
+#endif
}
bool CreateDesktopShortcut(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698