| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 #ifndef CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ | 5 #ifndef CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ |
| 6 #define CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ | 6 #define CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 8 #include <wrl.h> | 10 #include <wrl.h> |
| 9 | 11 |
| 10 #include <utility> | 12 #include <utility> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/macros.h" | 15 #include "base/macros.h" |
| 14 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 15 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 16 #include "ipc/ipc_message.h" | 18 #include "ipc/ipc_message.h" |
| 17 #include "ipc/ipc_sender.h" | 19 #include "ipc/ipc_sender.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 bool Send(IPC::Message* msg) override; | 101 bool Send(IPC::Message* msg) override; |
| 100 | 102 |
| 101 private: | 103 private: |
| 102 void OnFindFamily(const base::string16& family_name, uint32_t* index); | 104 void OnFindFamily(const base::string16& family_name, uint32_t* index); |
| 103 | 105 |
| 104 void OnGetFamilyCount(uint32_t* count); | 106 void OnGetFamilyCount(uint32_t* count); |
| 105 | 107 |
| 106 void OnGetFamilyNames( | 108 void OnGetFamilyNames( |
| 107 uint32_t family_index, | 109 uint32_t family_index, |
| 108 std::vector<std::pair<base::string16, base::string16>>* family_names); | 110 std::vector<std::pair<base::string16, base::string16>>* family_names); |
| 109 void OnGetFontFiles(uint32 family_index, | 111 void OnGetFontFiles(uint32_t family_index, |
| 110 std::vector<base::string16>* file_paths_); | 112 std::vector<base::string16>* file_paths_); |
| 111 | 113 |
| 112 private: | 114 private: |
| 113 scoped_refptr<FakeFontCollection> collection_; | 115 scoped_refptr<FakeFontCollection> collection_; |
| 114 scoped_ptr<IPC::Message> reply_; | 116 scoped_ptr<IPC::Message> reply_; |
| 115 | 117 |
| 116 DISALLOW_COPY_AND_ASSIGN(ReplySender); | 118 DISALLOW_COPY_AND_ASSIGN(ReplySender); |
| 117 }; | 119 }; |
| 118 | 120 |
| 119 // This class can be used by the "renderer" to send messages to the "browser" | 121 // This class can be used by the "renderer" to send messages to the "browser" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 133 }; | 135 }; |
| 134 | 136 |
| 135 void OnFindFamily(const base::string16& family_name, uint32_t* index); | 137 void OnFindFamily(const base::string16& family_name, uint32_t* index); |
| 136 | 138 |
| 137 void OnGetFamilyCount(uint32_t* count); | 139 void OnGetFamilyCount(uint32_t* count); |
| 138 | 140 |
| 139 void OnGetFamilyNames( | 141 void OnGetFamilyNames( |
| 140 uint32_t family_index, | 142 uint32_t family_index, |
| 141 std::vector<std::pair<base::string16, base::string16>>* family_names); | 143 std::vector<std::pair<base::string16, base::string16>>* family_names); |
| 142 | 144 |
| 143 void OnGetFontFiles(uint32 family_index, | 145 void OnGetFontFiles(uint32_t family_index, |
| 144 std::vector<base::string16>* file_paths); | 146 std::vector<base::string16>* file_paths); |
| 145 | 147 |
| 146 std::unique_ptr<ReplySender> GetReplySender(); | 148 std::unique_ptr<ReplySender> GetReplySender(); |
| 147 | 149 |
| 148 private: | 150 private: |
| 149 friend class base::RefCounted<FakeFontCollection>; | 151 friend class base::RefCounted<FakeFontCollection>; |
| 150 ~FakeFontCollection(); | 152 ~FakeFontCollection(); |
| 151 | 153 |
| 152 std::vector<FakeFont> fonts_; | 154 std::vector<FakeFont> fonts_; |
| 153 std::vector<std::unique_ptr<IPC::Message>> messages_; | 155 std::vector<std::unique_ptr<IPC::Message>> messages_; |
| 154 | 156 |
| 155 DISALLOW_COPY_AND_ASSIGN(FakeFontCollection); | 157 DISALLOW_COPY_AND_ASSIGN(FakeFontCollection); |
| 156 }; | 158 }; |
| 157 | 159 |
| 158 } // namespace content | 160 } // namespace content |
| 159 | 161 |
| 160 #endif // CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ | 162 #endif // CONTENT_TEST_DWRITE_FONT_FAKE_SENDER_WIN_H_ |
| OLD | NEW |