OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_system_provider/file_system_pr ovider_api.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/file_system_provider/service.h" | 7 #include "chrome/browser/chromeos/file_system_provider/service.h" |
8 #include "chrome/common/extensions/api/file_system_provider.h" | 8 #include "chrome/common/extensions/api/file_system_provider.h" |
9 | 9 |
10 namespace extensions { | 10 namespace extensions { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 result->Append(CreateError(kSecurityErrorName, | 44 result->Append(CreateError(kSecurityErrorName, |
45 kEmptyNameErrorMessage)); | 45 kEmptyNameErrorMessage)); |
46 SetResult(result); | 46 SetResult(result); |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 chromeos::file_system_provider::Service* service = | 50 chromeos::file_system_provider::Service* service = |
51 chromeos::file_system_provider::Service::Get(GetProfile()); | 51 chromeos::file_system_provider::Service::Get(GetProfile()); |
52 DCHECK(service); | 52 DCHECK(service); |
53 | 53 |
54 const std::string file_system_id = | 54 int file_system_id = |
55 service->RegisterFileSystem(extension_id(), params->display_name); | 55 service->RegisterFileSystem(extension_id(), params->display_name); |
56 | 56 |
57 // If the |file_system_id| is empty, then it means that registering the file | 57 // If the |file_system_id| is empty, then it means that registering the file |
satorux1
2014/03/26 07:58:45
zero
mtomasz
2014/03/26 09:30:15
Done.
| |
58 // system failed. | 58 // system failed. |
59 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. | 59 // TODO(mtomasz): Pass more detailed errors, rather than just a bool. |
60 if (file_system_id.empty()) { | 60 if (!file_system_id) { |
61 base::ListValue* result = new base::ListValue(); | 61 base::ListValue* result = new base::ListValue(); |
62 result->Append(new base::StringValue("")); | 62 result->Append(new base::FundamentalValue(0)); |
63 result->Append( | 63 result->Append( |
64 CreateError(kSecurityErrorName, kRegisteringFailedErrorMessage)); | 64 CreateError(kSecurityErrorName, kRegisteringFailedErrorMessage)); |
65 SetResult(result); | 65 SetResult(result); |
66 return false; | 66 return false; |
67 } | 67 } |
68 | 68 |
69 base::ListValue* result = new base::ListValue(); | 69 base::ListValue* result = new base::ListValue(); |
70 result->Append(new base::StringValue(file_system_id)); | 70 result->Append(new base::FundamentalValue(file_system_id)); |
71 // Don't append an error on success. | 71 // Don't append an error on success. |
72 | 72 |
73 SetResult(result); | 73 SetResult(result); |
74 SendResponse(true); | 74 SendResponse(true); |
75 return true; | 75 return true; |
76 } | 76 } |
77 | 77 |
78 } // namespace extensions | 78 } // namespace extensions |
OLD | NEW |