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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_bookmark_observer.cc

Issue 2512073002: [Offline Pages] Removes two-step expiration related. (Closed)
Patch Set: adding unit in histograms. Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/android/offline_pages/offline_page_bookmark_observer.h" 5 #include "chrome/browser/android/offline_pages/offline_page_bookmark_observer.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "components/bookmarks/browser/bookmark_node.h" 8 #include "components/bookmarks/browser/bookmark_node.h"
9 #include "components/offline_pages/client_namespace_constants.h" 9 #include "components/offline_pages/client_namespace_constants.h"
10 #include "components/offline_pages/offline_page_model.h" 10 #include "components/offline_pages/offline_page_model.h"
(...skipping 17 matching lines...) Expand all
28 int old_index, 28 int old_index,
29 const bookmarks::BookmarkNode* node, 29 const bookmarks::BookmarkNode* node,
30 const std::set<GURL>& removed_urls) { 30 const std::set<GURL>& removed_urls) {
31 if (!offline_page_model_) { 31 if (!offline_page_model_) {
32 offline_page_model_ = 32 offline_page_model_ =
33 OfflinePageModelFactory::GetForBrowserContext(context_); 33 OfflinePageModelFactory::GetForBrowserContext(context_);
34 } 34 }
35 ClientId client_id = ClientId(kBookmarkNamespace, std::to_string(node->id())); 35 ClientId client_id = ClientId(kBookmarkNamespace, std::to_string(node->id()));
36 offline_page_model_->GetOfflineIdsForClientId( 36 offline_page_model_->GetOfflineIdsForClientId(
37 client_id, 37 client_id,
38 base::Bind(&OfflinePageBookmarkObserver::DoExpireRemovedBookmarkPages, 38 base::Bind(&OfflinePageBookmarkObserver::DoDeleteRemovedBookmarkPages,
39 weak_ptr_factory_.GetWeakPtr())); 39 weak_ptr_factory_.GetWeakPtr()));
40 } 40 }
41 41
42 void OfflinePageBookmarkObserver::DoExpireRemovedBookmarkPages( 42 void OfflinePageBookmarkObserver::DoDeleteRemovedBookmarkPages(
43 const MultipleOfflineIdResult& offline_ids) { 43 const MultipleOfflineIdResult& offline_ids) {
44 offline_page_model_->ExpirePages( 44 offline_page_model_->DeletePagesByOfflineId(
45 offline_ids, base::Time::Now(), 45 offline_ids,
46 base::Bind(&OfflinePageBookmarkObserver::OnExpireRemovedBookmarkPagesDone, 46 base::Bind(&OfflinePageBookmarkObserver::OnDeleteRemovedBookmarkPagesDone,
47 weak_ptr_factory_.GetWeakPtr())); 47 weak_ptr_factory_.GetWeakPtr()));
48 } 48 }
49 49
50 void OfflinePageBookmarkObserver::OnExpireRemovedBookmarkPagesDone( 50 void OfflinePageBookmarkObserver::OnDeleteRemovedBookmarkPagesDone(
51 bool result) {} 51 DeletePageResult result) {}
52 52
53 } // namespace offline_pages 53 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698