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

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

Issue 8872036: Profiles: Move NetworkActionPredictor to the ProfileKeyedService framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add comment as reminder 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
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 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) 1584 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage))
1585 return GURL(chrome::kChromeUINewTabURL); 1585 return GURL(chrome::kChromeUINewTabURL);
1586 GURL home_page(URLFixerUpper::FixupURL( 1586 GURL home_page(URLFixerUpper::FixupURL(
1587 GetPrefs()->GetString(prefs::kHomePage), 1587 GetPrefs()->GetString(prefs::kHomePage),
1588 std::string())); 1588 std::string()));
1589 if (!home_page.is_valid()) 1589 if (!home_page.is_valid())
1590 return GURL(chrome::kChromeUINewTabURL); 1590 return GURL(chrome::kChromeUINewTabURL);
1591 return home_page; 1591 return home_page;
1592 } 1592 }
1593 1593
1594 NetworkActionPredictor* ProfileImpl::GetNetworkActionPredictor() {
1595 if (!network_action_predictor_.get())
1596 network_action_predictor_.reset(new NetworkActionPredictor(this));
1597 return network_action_predictor_.get();
1598 }
1599
1600 void ProfileImpl::SaveSessionState() { 1594 void ProfileImpl::SaveSessionState() {
1601 if (!session_restore_enabled_) 1595 if (!session_restore_enabled_)
1602 return; 1596 return;
1603 if (webkit_context_.get()) 1597 if (webkit_context_.get())
1604 webkit_context_->SaveSessionState(); 1598 webkit_context_->SaveSessionState();
1605 if (db_tracker_.get()) 1599 if (db_tracker_.get())
1606 db_tracker_->SaveSessionState(); 1600 db_tracker_->SaveSessionState();
1607 1601
1608 BrowserThread::PostTask( 1602 BrowserThread::PostTask(
1609 BrowserThread::IO, FROM_HERE, 1603 BrowserThread::IO, FROM_HERE,
(...skipping 28 matching lines...) Expand all
1638 FilePath* cache_path, 1632 FilePath* cache_path,
1639 int* max_size) { 1633 int* max_size) {
1640 DCHECK(cache_path); 1634 DCHECK(cache_path);
1641 DCHECK(max_size); 1635 DCHECK(max_size);
1642 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1636 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1643 if (!path.empty()) 1637 if (!path.empty())
1644 *cache_path = path; 1638 *cache_path = path;
1645 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1639 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1646 prefs_->GetInteger(prefs::kDiskCacheSize); 1640 prefs_->GetInteger(prefs::kDiskCacheSize);
1647 } 1641 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698