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

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

Issue 10867019: [sync] Add hooks to allow for testing sync credential caching in the presence of strange singleton … (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 | « chrome/browser/sync/credential_cache_service_win.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/command_line.h"
13 #include "base/file_path.h" 14 #include "base/file_path.h"
14 #include "base/path_service.h" 15 #include "base/path_service.h"
15 #include "base/win/metro.h" 16 #include "base/win/metro.h"
16 #include "base/win/scoped_co_mem.h" 17 #include "base/win/scoped_co_mem.h"
17 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/chrome_switches.h"
18 #include "chrome/installer/util/browser_distribution.h" 20 #include "chrome/installer/util/browser_distribution.h"
19 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
20 22
21 namespace chrome { 23 namespace chrome {
22 24
23 namespace { 25 namespace {
24 26
25 // Gets the default user data directory for either the current environment 27 // Gets the default user data directory for either the current environment
26 // (desktop or metro) or for the other one (metro or desktop). 28 // (desktop or metro) or for the other one (metro or desktop).
27 bool GetUserDataDirectoryForEnvironment(bool current, FilePath* result) { 29 bool GetUserDataDirectoryForEnvironment(bool current, FilePath* result) {
28 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result)) 30 if (!PathService::Get(base::DIR_LOCAL_APP_DATA, result))
29 return false; 31 return false;
30 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 32 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
31 *result = result->Append(dist->GetInstallSubDir()); 33 *result = result->Append(dist->GetInstallSubDir());
34
35 // TODO(rsimha): Continue to return the "Metro" subdirectory to allow testing
36 // of sync credential caching in the presence of strange singleton mode.
37 // Delete this block before shipping. See http://crbug.com/144280.
38 const CommandLine* command_line = CommandLine::ForCurrentProcess();
39 if ((command_line->HasSwitch(switches::kEnableSyncCredentialCaching)) &&
40 (base::win::IsMetroProcess() ? current : !current)) {
41 *result = result->Append(kMetroChromeUserDataSubDir);
42 }
43
32 *result = result->Append(chrome::kUserDataDirname); 44 *result = result->Append(chrome::kUserDataDirname);
33 return true; 45 return true;
34 } 46 }
35 47
36 } // namespace 48 } // namespace
37 49
38 bool GetDefaultUserDataDirectory(FilePath* result) { 50 bool GetDefaultUserDataDirectory(FilePath* result) {
39 return GetUserDataDirectoryForEnvironment(true, result); 51 return GetUserDataDirectoryForEnvironment(true, result);
40 } 52 }
41 53
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // investigated and fixed if possible. 142 // investigated and fixed if possible.
131 return process_type.empty() || 143 return process_type.empty() ||
132 process_type == switches::kServiceProcess || 144 process_type == switches::kServiceProcess ||
133 process_type == switches::kGpuProcess || 145 process_type == switches::kGpuProcess ||
134 process_type == switches::kNaClBrokerProcess || 146 process_type == switches::kNaClBrokerProcess ||
135 process_type == switches::kNaClLoaderProcess || 147 process_type == switches::kNaClLoaderProcess ||
136 process_type == switches::kPpapiBrokerProcess; 148 process_type == switches::kPpapiBrokerProcess;
137 } 149 }
138 150
139 } // namespace chrome 151 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/sync/credential_cache_service_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698