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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 853743002: First pass at fixing guest browser cookies issue. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete the Profile Manager. Guest Profile doesn't write to autocomplete/history. Views still needs … Created 5 years, 10 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/profiles/profile_manager.h" 5 #include "chrome/browser/profiles/profile_manager.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 // static 596 // static
597 base::FilePath ProfileManager::GetSystemProfilePath() { 597 base::FilePath ProfileManager::GetSystemProfilePath() {
598 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 598 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
599 599
600 ProfileManager* profile_manager = g_browser_process->profile_manager(); 600 ProfileManager* profile_manager = g_browser_process->profile_manager();
601 601
602 base::FilePath system_path = profile_manager->user_data_dir(); 602 base::FilePath system_path = profile_manager->user_data_dir();
603 return system_path.Append(chrome::kSystemProfileDir); 603 return system_path.Append(chrome::kSystemProfileDir);
604 } 604 }
605 605
606 void ProfileManager::DeleteProfile(Profile* profile) {
607 DCHECK(profile->IsGuestSession());
608
609 if (BrowserList::IsOffTheRecordSessionActiveForProfile(profile))
610 return;
611
612 ProfilesInfoMap::iterator iter = profiles_info_.find(profile->GetPath());
613 DCHECK(iter != profiles_info_.end());
614 profiles_info_.erase(iter);
615 }
616
606 base::FilePath ProfileManager::GenerateNextProfileDirectoryPath() { 617 base::FilePath ProfileManager::GenerateNextProfileDirectoryPath() {
607 PrefService* local_state = g_browser_process->local_state(); 618 PrefService* local_state = g_browser_process->local_state();
608 DCHECK(local_state); 619 DCHECK(local_state);
609 620
610 DCHECK(profiles::IsMultipleProfilesEnabled()); 621 DCHECK(profiles::IsMultipleProfilesEnabled());
611 622
612 // Create the next profile in the next available directory slot. 623 // Create the next profile in the next available directory slot.
613 int next_directory = local_state->GetInteger(prefs::kProfilesNumCreated); 624 int next_directory = local_state->GetInteger(prefs::kProfilesNumCreated);
614 std::string profile_name = chrome::kMultiProfileDirPrefix; 625 std::string profile_name = chrome::kMultiProfileDirPrefix;
615 profile_name.append(base::IntToString(next_directory)); 626 profile_name.append(base::IntToString(next_directory));
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1366 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); 1377 last_non_supervised_profile_path.BaseName().MaybeAsASCII());
1367 FinishDeletingProfile(profile_to_delete_path); 1378 FinishDeletingProfile(profile_to_delete_path);
1368 } 1379 }
1369 } 1380 }
1370 } 1381 }
1371 #endif 1382 #endif
1372 1383
1373 ProfileManagerWithoutInit::ProfileManagerWithoutInit( 1384 ProfileManagerWithoutInit::ProfileManagerWithoutInit(
1374 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { 1385 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) {
1375 } 1386 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | chrome/browser/ui/app_list/app_list_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698