diff options
author | jianli <jianli@chromium.org> | 2016-03-03 15:13:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-03 23:15:02 +0000 |
commit | 470304eaca40341a6ee888d005ce7877a06b2bb8 (patch) | |
tree | e8fb0de32774c569b39b5adcc337d139203da7b7 /components/offline_pages | |
parent | 9d40dcc9bf4d719c8dd856ff6c6474cd03f03c9b (diff) | |
download | chromium_src-470304eaca40341a6ee888d005ce7877a06b2bb8.zip chromium_src-470304eaca40341a6ee888d005ce7877a06b2bb8.tar.gz chromium_src-470304eaca40341a6ee888d005ce7877a06b2bb8.tar.bz2 |
Enable offline pages feature on trunk by default
BUG=none
Review URL: https://codereview.chromium.org/1758473002
Cr-Commit-Position: refs/heads/master@{#379130}
Diffstat (limited to 'components/offline_pages')
-rw-r--r-- | components/offline_pages/offline_page_feature.cc | 2 | ||||
-rw-r--r-- | components/offline_pages/offline_page_model.cc | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/components/offline_pages/offline_page_feature.cc b/components/offline_pages/offline_page_feature.cc index beee145..9c2d3cb 100644 --- a/components/offline_pages/offline_page_feature.cc +++ b/components/offline_pages/offline_page_feature.cc @@ -62,7 +62,7 @@ FeatureMode GetOfflinePageFeatureMode() { base::CompareCase::SENSITIVE)) { return FeatureMode::ENABLED_AS_SAVED_PAGES; } - return FeatureMode::DISABLED; + return FeatureMode::ENABLED_AS_BOOKMARKS; } bool IsOfflinePagesEnabled() { diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc index 7f4b60c..bdb61e3 100644 --- a/components/offline_pages/offline_page_model.cc +++ b/components/offline_pages/offline_page_model.cc @@ -284,7 +284,12 @@ void OfflinePageModel::ClearAll(const base::Closure& callback) { } bool OfflinePageModel::HasOfflinePages() const { - DCHECK(is_loaded_); + // Since offline pages feature is enabled by default, + // NetErrorTabHelper::SetHasOfflinePages might call this before the model is + // fully loaded. If so, just bail out since this is most likely due to tests. + if (!is_loaded_) + return false; + // Check that at least one page is not marked for deletion. Because we have // pages marked for deletion, we cannot simply invert result of |empty()|. for (const auto& id_page_pair : offline_pages_) { |