Make USB permissions work in the new permission message system
[chromium-blink-merge.git] / content / browser / fileapi / mock_file_change_observer.cc
blob6677607deb63860d66ee062cf6077ea1f98af3be
1 // Copyright 2014 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 "content/browser/fileapi/mock_file_change_observer.h"
7 #include "base/thread_task_runner_handle.h"
9 namespace storage {
11 MockFileChangeObserver::MockFileChangeObserver()
12 : create_file_count_(0),
13 create_file_from_count_(0),
14 remove_file_count_(0),
15 modify_file_count_(0),
16 create_directory_count_(0),
17 remove_directory_count_(0) {}
19 MockFileChangeObserver::~MockFileChangeObserver() {}
21 // static
22 ChangeObserverList MockFileChangeObserver::CreateList(
23 MockFileChangeObserver* observer) {
24 ChangeObserverList list;
25 return list.AddObserver(observer, base::ThreadTaskRunnerHandle::Get().get());
28 void MockFileChangeObserver::OnCreateFile(const FileSystemURL& url) {
29 create_file_count_++;
32 void MockFileChangeObserver::OnCreateFileFrom(const FileSystemURL& url,
33 const FileSystemURL& src) {
34 create_file_from_count_++;
37 void MockFileChangeObserver::OnRemoveFile(const FileSystemURL& url) {
38 remove_file_count_++;
41 void MockFileChangeObserver::OnModifyFile(const FileSystemURL& url) {
42 modify_file_count_++;
45 void MockFileChangeObserver::OnCreateDirectory(const FileSystemURL& url) {
46 create_directory_count_++;
49 void MockFileChangeObserver::OnRemoveDirectory(const FileSystemURL& url) {
50 remove_directory_count_++;
53 } // namespace storage