| OLD | NEW | 
|    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/shell_integration_linux.h" |    5 #include "chrome/browser/shell_integration_linux.h" | 
|    6  |    6  | 
|    7 #include <fcntl.h> |    7 #include <fcntl.h> | 
|    8 #include <glib.h> |    8 #include <glib.h> | 
|    9 #include <stdlib.h> |    9 #include <stdlib.h> | 
|   10 #include <sys/stat.h> |   10 #include <sys/stat.h> | 
| (...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  754     g_key_file_set_string(key_file, kDesktopEntry, "Icon", icon_name.c_str()); |  754     g_key_file_set_string(key_file, kDesktopEntry, "Icon", icon_name.c_str()); | 
|  755   } else { |  755   } else { | 
|  756     g_key_file_set_string(key_file, kDesktopEntry, "Icon", |  756     g_key_file_set_string(key_file, kDesktopEntry, "Icon", | 
|  757                           GetIconName().c_str()); |  757                           GetIconName().c_str()); | 
|  758   } |  758   } | 
|  759  |  759  | 
|  760   // Set the "NoDisplay" key. |  760   // Set the "NoDisplay" key. | 
|  761   if (no_display) |  761   if (no_display) | 
|  762     g_key_file_set_string(key_file, kDesktopEntry, "NoDisplay", "true"); |  762     g_key_file_set_string(key_file, kDesktopEntry, "NoDisplay", "true"); | 
|  763  |  763  | 
|  764 #if defined(TOOLKIT_GTK) |  | 
|  765   std::string wmclass = web_app::GetWMClassFromAppName(app_name); |  764   std::string wmclass = web_app::GetWMClassFromAppName(app_name); | 
|  766   g_key_file_set_string(key_file, kDesktopEntry, "StartupWMClass", |  765   g_key_file_set_string(key_file, kDesktopEntry, "StartupWMClass", | 
|  767                         wmclass.c_str()); |  766                         wmclass.c_str()); | 
|  768 #endif |  | 
|  769  |  767  | 
|  770   gsize length = 0; |  768   gsize length = 0; | 
|  771   gchar* data_dump = g_key_file_to_data(key_file, &length, NULL); |  769   gchar* data_dump = g_key_file_to_data(key_file, &length, NULL); | 
|  772   if (data_dump) { |  770   if (data_dump) { | 
|  773     // If strlen(data_dump[0]) == 0, this check will fail. |  771     // If strlen(data_dump[0]) == 0, this check will fail. | 
|  774     if (data_dump[0] == '\n') { |  772     if (data_dump[0] == '\n') { | 
|  775       // Older versions of glib produce a leading newline. If this is the case, |  773       // Older versions of glib produce a leading newline. If this is the case, | 
|  776       // remove it to avoid double-newline after the shebang. |  774       // remove it to avoid double-newline after the shebang. | 
|  777       output_buffer += (data_dump + 1); |  775       output_buffer += (data_dump + 1); | 
|  778     } else { |  776     } else { | 
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  942     for (std::vector<base::FilePath>::const_iterator it = |  940     for (std::vector<base::FilePath>::const_iterator it = | 
|  943          shortcut_filenames_app_menu.begin(); |  941          shortcut_filenames_app_menu.begin(); | 
|  944          it != shortcut_filenames_app_menu.end(); ++it) { |  942          it != shortcut_filenames_app_menu.end(); ++it) { | 
|  945       DeleteShortcutInApplicationsMenu(*it, |  943       DeleteShortcutInApplicationsMenu(*it, | 
|  946                                        base::FilePath(kDirectoryFilename)); |  944                                        base::FilePath(kDirectoryFilename)); | 
|  947     } |  945     } | 
|  948   } |  946   } | 
|  949 } |  947 } | 
|  950  |  948  | 
|  951 }  // namespace ShellIntegrationLinux |  949 }  // namespace ShellIntegrationLinux | 
| OLD | NEW |