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

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

Issue 2924433002: Change linux default hidden file save directory to XDG_DATA_HOME (Closed)
Patch Set: Use XDG_CONFIG_HOME Created 3 years, 6 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
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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 // Just return the name of the executable path for Chrome. 556 // Just return the name of the executable path for Chrome.
557 base::FilePath chrome_exe_path; 557 base::FilePath chrome_exe_path;
558 PathService::Get(base::FILE_EXE, &chrome_exe_path); 558 PathService::Get(base::FILE_EXE, &chrome_exe_path);
559 return chrome_exe_path; 559 return chrome_exe_path;
560 } 560 }
561 561
562 } // namespace 562 } // namespace
563 563
564 base::FilePath GetDataWriteLocation(base::Environment* env) { 564 base::FilePath GetDataWriteLocation(base::Environment* env) {
565 base::ThreadRestrictions::AssertIOAllowed();
Lei Zhang 2017/06/07 06:48:33 Comment still says "called on the FILE thread" in
Tom Anderson 2017/06/07 18:38:38 Done.
566
567 return base::nix::GetXDGDirectory(env, "XDG_DATA_HOME", ".local/share"); 565 return base::nix::GetXDGDirectory(env, "XDG_DATA_HOME", ".local/share");
568 } 566 }
569 567
570 std::vector<base::FilePath> GetDataSearchLocations(base::Environment* env) { 568 std::vector<base::FilePath> GetDataSearchLocations(base::Environment* env) {
571 base::ThreadRestrictions::AssertIOAllowed(); 569 base::ThreadRestrictions::AssertIOAllowed();
572 570
573 std::vector<base::FilePath> search_paths; 571 std::vector<base::FilePath> search_paths;
574 base::FilePath write_location = GetDataWriteLocation(env); 572 base::FilePath write_location = GetDataWriteLocation(env);
575 search_paths.push_back(write_location); 573 search_paths.push_back(write_location);
576 574
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 base::FilePath applications_menu = GetDataWriteLocation(env.get()); 1101 base::FilePath applications_menu = GetDataWriteLocation(env.get());
1104 applications_menu = applications_menu.AppendASCII("applications"); 1102 applications_menu = applications_menu.AppendASCII("applications");
1105 std::vector<base::FilePath> shortcut_filenames_app_menu = 1103 std::vector<base::FilePath> shortcut_filenames_app_menu =
1106 GetExistingProfileShortcutFilenames(profile_path, applications_menu); 1104 GetExistingProfileShortcutFilenames(profile_path, applications_menu);
1107 for (const auto& menu : shortcut_filenames_app_menu) { 1105 for (const auto& menu : shortcut_filenames_app_menu) {
1108 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename)); 1106 DeleteShortcutInApplicationsMenu(menu, base::FilePath(kDirectoryFilename));
1109 } 1107 }
1110 } 1108 }
1111 1109
1112 } // namespace shell_integration_linux 1110 } // namespace shell_integration_linux
OLDNEW
« chrome/browser/download/download_prefs.cc ('K') | « chrome/browser/download/download_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698