Add tests to verify accelerators properly work on constrained window.
[chromium-blink-merge.git] / sync / notifier / invalidation_util.h
blob670f61209ea1cae00fbf011b3a398fd001c408c3
1 // Copyright 2012 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 // Various utilities for dealing with invalidation data types.
7 #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_
8 #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_
10 #include <iosfwd>
11 #include <set>
12 #include <string>
14 #include "base/memory/scoped_ptr.h"
15 #include "sync/base/sync_export.h"
16 #include "sync/internal_api/public/base/model_type.h"
18 namespace base {
19 class DictionaryValue;
20 } // namespace
22 namespace invalidation {
24 class Invalidation;
25 class ObjectId;
27 // Gmock print helper
28 SYNC_EXPORT_PRIVATE void PrintTo(const invalidation::ObjectId& id,
29 std::ostream* os);
31 } // namespace invalidation
33 namespace syncer {
35 struct SYNC_EXPORT ObjectIdLessThan {
36 bool operator()(const invalidation::ObjectId& lhs,
37 const invalidation::ObjectId& rhs) const;
40 typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet;
42 SYNC_EXPORT bool RealModelTypeToObjectId(ModelType model_type,
43 invalidation::ObjectId* object_id);
45 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
46 ModelType* model_type);
48 // Caller owns the returned DictionaryValue.
49 scoped_ptr<base::DictionaryValue> ObjectIdToValue(
50 const invalidation::ObjectId& object_id);
52 bool ObjectIdFromValue(const base::DictionaryValue& value,
53 invalidation::ObjectId* out);
55 SYNC_EXPORT_PRIVATE std::string ObjectIdToString(
56 const invalidation::ObjectId& object_id);
58 SYNC_EXPORT_PRIVATE ObjectIdSet ModelTypeSetToObjectIdSet(ModelTypeSet models);
59 ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids);
61 std::string InvalidationToString(
62 const invalidation::Invalidation& invalidation);
64 } // namespace syncer
66 #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_