ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / browsing_data / mock_browsing_data_flash_lso_helper.cc
blob22a153ad6f1e210f1e966642c2c471aca7fb9b9e
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/browsing_data/mock_browsing_data_flash_lso_helper.h"
7 #include <algorithm>
9 #include "testing/gtest/include/gtest/gtest.h"
11 MockBrowsingDataFlashLSOHelper::MockBrowsingDataFlashLSOHelper(
12 content::BrowserContext* browser_context) {
14 void MockBrowsingDataFlashLSOHelper::StartFetching(
15 const GetSitesWithFlashDataCallback& callback) {
16 ASSERT_FALSE(callback.is_null());
17 ASSERT_TRUE(callback_.is_null());
18 callback_ = callback;
21 void MockBrowsingDataFlashLSOHelper::DeleteFlashLSOsForSite(
22 const std::string& site) {
23 std::vector<std::string>::iterator entry =
24 std::find(domains_.begin(), domains_.end(), site);
25 ASSERT_TRUE(entry != domains_.end());
26 domains_.erase(entry);
29 void MockBrowsingDataFlashLSOHelper::AddFlashLSODomain(
30 const std::string& domain) {
31 domains_.push_back(domain);
34 void MockBrowsingDataFlashLSOHelper::Notify() {
35 callback_.Run(domains_);
36 callback_ = GetSitesWithFlashDataCallback();
39 bool MockBrowsingDataFlashLSOHelper::AllDeleted() {
40 return domains_.empty();
43 MockBrowsingDataFlashLSOHelper::~MockBrowsingDataFlashLSOHelper() {