| 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 | 8 |
| 9 #if defined(USE_GLIB) | 9 #if defined(USE_GLIB) |
| 10 #include <glib.h> | 10 #include <glib.h> |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 const base::CommandLine* command_line = | 579 const base::CommandLine* command_line = |
| 580 base::CommandLine::ForCurrentProcess(); | 580 base::CommandLine::ForCurrentProcess(); |
| 581 std::string class_name = command_line->GetProgram().BaseName().value(); | 581 std::string class_name = command_line->GetProgram().BaseName().value(); |
| 582 if (!class_name.empty()) | 582 if (!class_name.empty()) |
| 583 class_name[0] = base::ToUpperASCII(class_name[0]); | 583 class_name[0] = base::ToUpperASCII(class_name[0]); |
| 584 return class_name; | 584 return class_name; |
| 585 } | 585 } |
| 586 | 586 |
| 587 std::string GetDesktopName(base::Environment* env) { | 587 std::string GetDesktopName(base::Environment* env) { |
| 588 #if defined(GOOGLE_CHROME_BUILD) | 588 #if defined(GOOGLE_CHROME_BUILD) |
| 589 chrome::VersionInfo::Channel product_channel( | 589 version_info::Channel product_channel( |
| 590 chrome::VersionInfo::GetChannel()); | 590 chrome::VersionInfo::GetChannel()); |
| 591 switch (product_channel) { | 591 switch (product_channel) { |
| 592 case chrome::VersionInfo::CHANNEL_DEV: | 592 case version_info::Channel::DEV: |
| 593 return "google-chrome-unstable.desktop"; | 593 return "google-chrome-unstable.desktop"; |
| 594 case chrome::VersionInfo::CHANNEL_BETA: | 594 case version_info::Channel::BETA: |
| 595 return "google-chrome-beta.desktop"; | 595 return "google-chrome-beta.desktop"; |
| 596 default: | 596 default: |
| 597 return "google-chrome.desktop"; | 597 return "google-chrome.desktop"; |
| 598 } | 598 } |
| 599 #else // CHROMIUM_BUILD | 599 #else // CHROMIUM_BUILD |
| 600 // Allow $CHROME_DESKTOP to override the built-in value, so that development | 600 // Allow $CHROME_DESKTOP to override the built-in value, so that development |
| 601 // versions can set themselves as the default without interfering with | 601 // versions can set themselves as the default without interfering with |
| 602 // non-official, packaged versions using the built-in value. | 602 // non-official, packaged versions using the built-in value. |
| 603 std::string name; | 603 std::string name; |
| 604 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) | 604 if (env->GetVar("CHROME_DESKTOP", &name) && !name.empty()) |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 base::FilePath applications_menu = GetDataWriteLocation(env.get()); | 1055 base::FilePath applications_menu = GetDataWriteLocation(env.get()); |
| 1056 applications_menu = applications_menu.AppendASCII("applications"); | 1056 applications_menu = applications_menu.AppendASCII("applications"); |
| 1057 std::vector<base::FilePath> shortcut_filenames_app_menu = | 1057 std::vector<base::FilePath> shortcut_filenames_app_menu = |
| 1058 GetExistingProfileShortcutFilenames(profile_path, applications_menu); | 1058 GetExistingProfileShortcutFilenames(profile_path, applications_menu); |
| 1059 for (const auto& menu : shortcut_filenames_app_menu) { | 1059 for (const auto& menu : shortcut_filenames_app_menu) { |
| 1060 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename)); | 1060 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename)); |
| 1061 } | 1061 } |
| 1062 } | 1062 } |
| 1063 | 1063 |
| 1064 } // namespace shell_integration_linux | 1064 } // namespace shell_integration_linux |
| OLD | NEW |