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

Side by Side Diff: chrome/browser/shell_integration_linux.cc

Issue 2195063003: Linux: Sync GetDesktopName in gtk2_util.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/gtk2_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 std::string GetProgramClassName() { 579 std::string GetProgramClassName() {
580 std::unique_ptr<base::Environment> env(base::Environment::Create()); 580 std::unique_ptr<base::Environment> env(base::Environment::Create());
581 std::string desktop_file(GetDesktopName(env.get())); 581 std::string desktop_file(GetDesktopName(env.get()));
582 std::size_t last = desktop_file.find(".desktop"); 582 std::size_t last = desktop_file.find(".desktop");
583 if (last != std::string::npos) 583 if (last != std::string::npos)
584 return desktop_file.substr(0, last); 584 return desktop_file.substr(0, last);
585 return desktop_file; 585 return desktop_file;
586 } 586 }
587 587
588 // This function should be kept in sync with the copy in gtk2_util.cc.
588 std::string GetDesktopName(base::Environment* env) { 589 std::string GetDesktopName(base::Environment* env) {
589 #if defined(GOOGLE_CHROME_BUILD) 590 #if defined(GOOGLE_CHROME_BUILD)
590 version_info::Channel product_channel(chrome::GetChannel()); 591 version_info::Channel product_channel(chrome::GetChannel());
591 switch (product_channel) { 592 switch (product_channel) {
592 case version_info::Channel::DEV: 593 case version_info::Channel::DEV:
593 return "google-chrome-unstable.desktop"; 594 return "google-chrome-unstable.desktop";
594 case version_info::Channel::BETA: 595 case version_info::Channel::BETA:
595 return "google-chrome-beta.desktop"; 596 return "google-chrome-beta.desktop";
596 default: 597 default:
597 return "google-chrome.desktop"; 598 return "google-chrome.desktop";
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 base::FilePath applications_menu = GetDataWriteLocation(env.get()); 1057 base::FilePath applications_menu = GetDataWriteLocation(env.get());
1057 applications_menu = applications_menu.AppendASCII("applications"); 1058 applications_menu = applications_menu.AppendASCII("applications");
1058 std::vector<base::FilePath> shortcut_filenames_app_menu = 1059 std::vector<base::FilePath> shortcut_filenames_app_menu =
1059 GetExistingProfileShortcutFilenames(profile_path, applications_menu); 1060 GetExistingProfileShortcutFilenames(profile_path, applications_menu);
1060 for (const auto& menu : shortcut_filenames_app_menu) { 1061 for (const auto& menu : shortcut_filenames_app_menu) {
1061 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename)); 1062 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename));
1062 } 1063 }
1063 } 1064 }
1064 1065
1065 } // namespace shell_integration_linux 1066 } // namespace shell_integration_linux
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/gtk2_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698