| 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 // Get the res_name component from argv[0]. | 578 // Get the res_name component from argv[0]. |
| 579 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 579 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 580 std::string class_name = command_line->GetProgram().BaseName().value(); | 580 std::string class_name = command_line->GetProgram().BaseName().value(); |
| 581 if (!class_name.empty()) | 581 if (!class_name.empty()) |
| 582 class_name[0] = base::ToUpperASCII(class_name[0]); | 582 class_name[0] = base::ToUpperASCII(class_name[0]); |
| 583 return class_name; | 583 return class_name; |
| 584 } | 584 } |
| 585 | 585 |
| 586 std::string GetDesktopName(base::Environment* env) { | 586 std::string GetDesktopName(base::Environment* env) { |
| 587 #if defined(GOOGLE_CHROME_BUILD) | 587 #if defined(GOOGLE_CHROME_BUILD) |
| 588 return "google-chrome.desktop"; | 588 chrome::VersionInfo::Channel product_channel( |
| 589 chrome::VersionInfo::GetChannel()); |
| 590 switch (product_channel) { |
| 591 case chrome::VersionInfo::CHANNEL_DEV: |
| 592 return "google-chrome-unstable.desktop"; |
| 593 case chrome::VersionInfo::CHANNEL_BETA: |
| 594 return "google-chrome-beta.desktop"; |
| 595 default: |
| 596 return "google-chrome.desktop"; |
| 597 } |
| 589 #else // CHROMIUM_BUILD | 598 #else // CHROMIUM_BUILD |
| 590 // Allow $CHROME_DESKTOP to override the built-in value, so that development | 599 // Allow $CHROME_DESKTOP to override the built-in value, so that development |
| 591 // versions can set themselves as the default without interfering with | 600 // versions can set themselves as the default without interfering with |
| 592 // non-official, packaged versions using the built-in value. | 601 // non-official, packaged versions using the built-in value. |
| 593 std::string name; | 602 std::string name; |
| 594 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) | 603 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) |
| 595 return name; | 604 return name; |
| 596 return "chromium-browser.desktop"; | 605 return "chromium-browser.desktop"; |
| 597 #endif | 606 #endif |
| 598 } | 607 } |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 for (std::vector<base::FilePath>::const_iterator it = | 1035 for (std::vector<base::FilePath>::const_iterator it = |
| 1027 shortcut_filenames_app_menu.begin(); | 1036 shortcut_filenames_app_menu.begin(); |
| 1028 it != shortcut_filenames_app_menu.end(); ++it) { | 1037 it != shortcut_filenames_app_menu.end(); ++it) { |
| 1029 DeleteShortcutInApplicationsMenu(*it, | 1038 DeleteShortcutInApplicationsMenu(*it, |
| 1030 base::FilePath(kDirectoryFilename)); | 1039 base::FilePath(kDirectoryFilename)); |
| 1031 } | 1040 } |
| 1032 } | 1041 } |
| 1033 } | 1042 } |
| 1034 | 1043 |
| 1035 } // namespace ShellIntegrationLinux | 1044 } // namespace ShellIntegrationLinux |
| OLD | NEW |