OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 #include "components/arc/file_system/file_system_struct_traits.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "components/arc/common/file_system.mojom.h" |
| 9 |
| 10 namespace mojo { |
| 11 |
| 12 // static |
| 13 arc::mojom::ChangeType |
| 14 EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>:: |
| 15 ToMojom(storage::WatcherManager::ChangeType type) { |
| 16 switch (type) { |
| 17 case storage::WatcherManager::CHANGED: |
| 18 return arc::mojom::ChangeType::CHANGED; |
| 19 case storage::WatcherManager::DELETED: |
| 20 return arc::mojom::ChangeType::DELETED; |
| 21 } |
| 22 NOTREACHED(); |
| 23 return arc::mojom::ChangeType::CHANGED; |
| 24 } |
| 25 |
| 26 // static |
| 27 bool EnumTraits<arc::mojom::ChangeType, storage::WatcherManager::ChangeType>:: |
| 28 FromMojom(arc::mojom::ChangeType mojom_type, |
| 29 storage::WatcherManager::ChangeType* type) { |
| 30 switch (mojom_type) { |
| 31 case arc::mojom::ChangeType::CHANGED: |
| 32 *type = storage::WatcherManager::CHANGED; |
| 33 return true; |
| 34 case arc::mojom::ChangeType::DELETED: |
| 35 *type = storage::WatcherManager::DELETED; |
| 36 return true; |
| 37 } |
| 38 NOTREACHED(); |
| 39 return false; |
| 40 } |
| 41 |
| 42 } // namespace mojo |
OLD | NEW |