OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "webkit/browser/fileapi/test_mount_point_provider.h" | 5 #include "webkit/browser/fileapi/test_mount_point_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 update_observers_ = UpdateObserverList(source); | 92 update_observers_ = UpdateObserverList(source); |
93 } | 93 } |
94 | 94 |
95 TestMountPointProvider::~TestMountPointProvider() { | 95 TestMountPointProvider::~TestMountPointProvider() { |
96 } | 96 } |
97 | 97 |
98 bool TestMountPointProvider::CanHandleType(FileSystemType type) const { | 98 bool TestMountPointProvider::CanHandleType(FileSystemType type) const { |
99 return (type == kFileSystemTypeTest); | 99 return (type == kFileSystemTypeTest); |
100 } | 100 } |
101 | 101 |
| 102 GURL TestMountPointProvider::GetRootURI(const GURL& origin_url, |
| 103 FileSystemType type) const { |
| 104 if (!CanHandleType(type)) |
| 105 return GURL(); |
| 106 return GetFileSystemRootURI(origin_url, type); |
| 107 } |
| 108 |
102 void TestMountPointProvider::OpenFileSystem( | 109 void TestMountPointProvider::OpenFileSystem( |
103 const GURL& origin_url, | 110 const GURL& origin_url, |
104 FileSystemType type, | 111 FileSystemType type, |
105 OpenFileSystemMode mode, | 112 OpenFileSystemMode mode, |
106 const OpenFileSystemCallback& callback) { | 113 const OpenFileSystemCallback& callback) { |
107 callback.Run(base::PLATFORM_FILE_OK); | 114 callback.Run(base::PLATFORM_FILE_OK); |
108 } | 115 } |
109 | 116 |
110 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { | 117 FileSystemFileUtil* TestMountPointProvider::GetFileUtil(FileSystemType type) { |
111 DCHECK(local_file_util_.get()); | 118 DCHECK(local_file_util_.get()); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 188 } |
182 | 189 |
183 void TestMountPointProvider::AddFileChangeObserver( | 190 void TestMountPointProvider::AddFileChangeObserver( |
184 FileChangeObserver* observer) { | 191 FileChangeObserver* observer) { |
185 ChangeObserverList::Source source = change_observers_.source(); | 192 ChangeObserverList::Source source = change_observers_.source(); |
186 source.AddObserver(observer, task_runner_.get()); | 193 source.AddObserver(observer, task_runner_.get()); |
187 change_observers_ = ChangeObserverList(source); | 194 change_observers_ = ChangeObserverList(source); |
188 } | 195 } |
189 | 196 |
190 } // namespace fileapi | 197 } // namespace fileapi |
OLD | NEW |