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

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

Issue 8745015: Store the "browser autorestarted, last session must be restored" information in a preference. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch set incomplete? Created 9 years 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/browser/chrome_browser_main_posix.cc ('k') | chrome/browser/ui/browser.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 int media_cache_max_size; 369 int media_cache_max_size;
370 GetCacheParameters(true, &media_cache_path, &media_cache_max_size); 370 GetCacheParameters(true, &media_cache_path, &media_cache_max_size);
371 media_cache_path = GetMediaCachePath(media_cache_path); 371 media_cache_path = GetMediaCachePath(media_cache_path);
372 372
373 FilePath extensions_cookie_path = GetPath(); 373 FilePath extensions_cookie_path = GetPath();
374 extensions_cookie_path = 374 extensions_cookie_path =
375 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename); 375 extensions_cookie_path.Append(chrome::kExtensionsCookieFilename);
376 376
377 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname); 377 FilePath app_path = GetPath().Append(chrome::kIsolatedAppStateDirname);
378 378
379 PrefService* pref_service = g_browser_process->local_state();
Miranda Callahan 2011/12/05 14:30:28 You actually already have this as a local variable
marja 2011/12/05 14:44:01 Done.
379 bool restore_old_session_cookies = 380 bool restore_old_session_cookies =
380 session_restore_enabled_ && 381 session_restore_enabled_ &&
381 (!DidLastSessionExitCleanly() || 382 (!DidLastSessionExitCleanly() ||
382 CommandLine::ForCurrentProcess()->HasSwitch( 383 CommandLine::ForCurrentProcess()->HasSwitch(
383 switches::kRestoreLastSession)); 384 switches::kRestoreLastSession) ||
385 pref_service->GetBoolean(prefs::kWasRestarted));
Miranda Callahan 2011/12/05 14:30:28 after removing the above declaration: local_State
marja 2011/12/05 14:44:01 Done.
384 386
385 // Make sure we initialize the ProfileIOData after everything else has been 387 // Make sure we initialize the ProfileIOData after everything else has been
386 // initialized that we might be reading from the IO thread. 388 // initialized that we might be reading from the IO thread.
387 389
388 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path, 390 io_data_.Init(cookie_path, origin_bound_cert_path, cache_path,
389 cache_max_size, media_cache_path, media_cache_max_size, 391 cache_max_size, media_cache_path, media_cache_max_size,
390 extensions_cookie_path, app_path, predictor_, 392 extensions_cookie_path, app_path, predictor_,
391 g_browser_process->local_state(), 393 g_browser_process->local_state(),
392 g_browser_process->io_thread(), 394 g_browser_process->io_thread(),
393 restore_old_session_cookies); 395 restore_old_session_cookies);
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 FilePath* cache_path, 1651 FilePath* cache_path,
1650 int* max_size) { 1652 int* max_size) {
1651 DCHECK(cache_path); 1653 DCHECK(cache_path);
1652 DCHECK(max_size); 1654 DCHECK(max_size);
1653 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1655 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1654 if (!path.empty()) 1656 if (!path.empty())
1655 *cache_path = path; 1657 *cache_path = path;
1656 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1658 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1657 prefs_->GetInteger(prefs::kDiskCacheSize); 1659 prefs_->GetInteger(prefs::kDiskCacheSize);
1658 } 1660 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_posix.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698