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

Side by Side Diff: chrome/common/chrome_paths_win.cc

Issue 10539153: Do not show the EULA if it has already been accepted by the user in another user data dir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DIR_ALT_USER_DATA is windows only Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_paths_unittest.cc ('k') | no next file » | 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/common/chrome_paths_internal.h" 5 #include "chrome/common/chrome_paths_internal.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <knownfolders.h> 8 #include <knownfolders.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
11 #include <shobjidl.h> 11 #include <shobjidl.h>
12 12
13 #include "base/file_path.h" 13 #include "base/file_path.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/win/metro.h" 15 #include "base/win/metro.h"
16 #include "base/win/scoped_co_mem.h" 16 #include "base/win/scoped_co_mem.h"
17 #include "chrome/common/chrome_constants.h" 17 #include "chrome/common/chrome_constants.h"
18 #include "chrome/installer/util/browser_distribution.h" 18 #include "chrome/installer/util/browser_distribution.h"
19 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
20 20
21 namespace chrome { 21 namespace chrome {
22 22
23 bool GetDefaultUserDataDirectory(FilePath* result) { 23 namespace {
24
25 // Gets the default user data directory for either the current environment
26 // (desktop or metro) or for the other one (metro or desktop).
27 bool GetUserDataDirectoryForEnvironment(bool current, FilePath* result) {
24 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) 28 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result))
25 return false; 29 return false;
26 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 30 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
27 *result = result->Append(dist->GetInstallSubDir()); 31 *result = result->Append(dist->GetInstallSubDir());
28 if (base::win::GetMetroModule()) 32 if (base::win::GetMetroModule() ? current : !current)
29 *result = result->Append(kMetroChromeUserDataSubDir); 33 *result = result->Append(kMetroChromeUserDataSubDir);
30 *result = result->Append(chrome::kUserDataDirname); 34 *result = result->Append(chrome::kUserDataDirname);
31 return true; 35 return true;
32 } 36 }
33 37
38 } // namespace
39
40 bool GetDefaultUserDataDirectory(FilePath* result) {
41 return GetUserDataDirectoryForEnvironment(true, result);
42 }
43
44 bool GetAlternateUserDataDirectory(FilePath *result) {
45 return GetUserDataDirectoryForEnvironment(false, result);
46 }
47
34 bool GetChromeFrameUserDataDirectory(FilePath* result) { 48 bool GetChromeFrameUserDataDirectory(FilePath* result) {
35 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) 49 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result))
36 return false; 50 return false;
37 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( 51 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution(
38 BrowserDistribution::CHROME_FRAME); 52 BrowserDistribution::CHROME_FRAME);
39 *result = result->Append(dist->GetInstallSubDir()); 53 *result = result->Append(dist->GetInstallSubDir());
40 *result = result->Append(chrome::kUserDataDirname); 54 *result = result->Append(chrome::kUserDataDirname);
41 return true; 55 return true;
42 } 56 }
43 57
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // investigated and fixed if possible. 132 // investigated and fixed if possible.
119 return process_type.empty() || 133 return process_type.empty() ||
120 process_type == switches::kServiceProcess || 134 process_type == switches::kServiceProcess ||
121 process_type == switches::kGpuProcess || 135 process_type == switches::kGpuProcess ||
122 process_type == switches::kNaClBrokerProcess || 136 process_type == switches::kNaClBrokerProcess ||
123 process_type == switches::kNaClLoaderProcess || 137 process_type == switches::kNaClLoaderProcess ||
124 process_type == switches::kPpapiBrokerProcess; 138 process_type == switches::kPpapiBrokerProcess;
125 } 139 }
126 140
127 } // namespace chrome 141 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_paths_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698