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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/operations/unobserve_entry.cc

Issue 625463002: [fsp] Add support for observing entries and notifying about changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More implementation. Created 6 years, 2 months 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
mtomasz 2014/10/03 04:22:47 This file is mostly a copy paste from observe_dire
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/file_system_provider/operations/unobserve_entr y.h"
6
7 #include <string>
8
9 #include "chrome/common/extensions/api/file_system_provider.h"
10 #include "chrome/common/extensions/api/file_system_provider_internal.h"
11
12 namespace chromeos {
13 namespace file_system_provider {
14 namespace operations {
15
16 UnobserveEntry::UnobserveEntry(
17 extensions::EventRouter* event_router,
18 const ProvidedFileSystemInfo& file_system_info,
19 const base::FilePath& entry_path,
20 const storage::AsyncFileUtil::StatusCallback& callback)
21 : Operation(event_router, file_system_info),
22 entry_path_(entry_path),
23 callback_(callback) {
24 }
25
26 UnobserveEntry::~UnobserveEntry() {
27 }
28
29 bool UnobserveEntry::Execute(int request_id) {
30 using extensions::api::file_system_provider::UnobserveEntryRequestedOptions;
31
32 UnobserveEntryRequestedOptions options;
33 options.file_system_id = file_system_info_.file_system_id();
34 options.request_id = request_id;
35 options.entry_path = entry_path_.AsUTF8Unsafe();
36
37 return SendEvent(
38 request_id,
39 extensions::api::file_system_provider::OnUnobserveEntryRequested::
40 kEventName,
41 extensions::api::file_system_provider::OnUnobserveEntryRequested::Create(
42 options));
43 }
44
45 void UnobserveEntry::OnSuccess(int /* request_id */,
46 scoped_ptr<RequestValue> /* result */,
47 bool has_more) {
48 callback_.Run(base::File::FILE_OK);
49 }
50
51 void UnobserveEntry::OnError(int /* request_id */,
52 scoped_ptr<RequestValue> /* result */,
53 base::File::Error error) {
54 callback_.Run(error);
55 }
56
57 } // namespace operations
58 } // namespace file_system_provider
59 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698