OLD | NEW |
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 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) | 1587 if (GetPrefs()->GetBoolean(prefs::kHomePageIsNewTabPage)) |
1588 return GURL(chrome::kChromeUINewTabURL); | 1588 return GURL(chrome::kChromeUINewTabURL); |
1589 GURL home_page(URLFixerUpper::FixupURL( | 1589 GURL home_page(URLFixerUpper::FixupURL( |
1590 GetPrefs()->GetString(prefs::kHomePage), | 1590 GetPrefs()->GetString(prefs::kHomePage), |
1591 std::string())); | 1591 std::string())); |
1592 if (!home_page.is_valid()) | 1592 if (!home_page.is_valid()) |
1593 return GURL(chrome::kChromeUINewTabURL); | 1593 return GURL(chrome::kChromeUINewTabURL); |
1594 return home_page; | 1594 return home_page; |
1595 } | 1595 } |
1596 | 1596 |
1597 NetworkActionPredictor* ProfileImpl::GetNetworkActionPredictor() { | |
1598 if (!network_action_predictor_.get()) | |
1599 network_action_predictor_.reset(new NetworkActionPredictor(this)); | |
1600 return network_action_predictor_.get(); | |
1601 } | |
1602 | |
1603 void ProfileImpl::SaveSessionState() { | 1597 void ProfileImpl::SaveSessionState() { |
1604 if (!session_restore_enabled_) | 1598 if (!session_restore_enabled_) |
1605 return; | 1599 return; |
1606 if (webkit_context_.get()) | 1600 if (webkit_context_.get()) |
1607 webkit_context_->SaveSessionState(); | 1601 webkit_context_->SaveSessionState(); |
1608 if (db_tracker_.get()) | 1602 if (db_tracker_.get()) |
1609 db_tracker_->SaveSessionState(); | 1603 db_tracker_->SaveSessionState(); |
1610 | 1604 |
1611 BrowserThread::PostTask( | 1605 BrowserThread::PostTask( |
1612 BrowserThread::IO, FROM_HERE, | 1606 BrowserThread::IO, FROM_HERE, |
(...skipping 28 matching lines...) Expand all Loading... |
1641 FilePath* cache_path, | 1635 FilePath* cache_path, |
1642 int* max_size) { | 1636 int* max_size) { |
1643 DCHECK(cache_path); | 1637 DCHECK(cache_path); |
1644 DCHECK(max_size); | 1638 DCHECK(max_size); |
1645 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1639 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1646 if (!path.empty()) | 1640 if (!path.empty()) |
1647 *cache_path = path; | 1641 *cache_path = path; |
1648 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1642 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1649 prefs_->GetInteger(prefs::kDiskCacheSize); | 1643 prefs_->GetInteger(prefs::kDiskCacheSize); |
1650 } | 1644 } |
OLD | NEW |