| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | 13 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class ListValue; | 16 class ListValue; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class WebUI; | 20 class WebUI; |
| 21 } | 21 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 // SettingsPageUIHandler implementation. | 33 // SettingsPageUIHandler implementation. |
| 34 void RegisterMessages() override; | 34 void RegisterMessages() override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 // Handler for script asking for font information. | 37 // Handler for script asking for font information. |
| 38 void HandleFetchFontsData(const base::ListValue* args); | 38 void HandleFetchFontsData(const base::ListValue* args); |
| 39 | 39 |
| 40 // Callback to handle fonts loading. | 40 // Callback to handle fonts loading. |
| 41 void FontListHasLoaded(std::string callback_id, | 41 void FontListHasLoaded(std::string callback_id, |
| 42 scoped_ptr<base::ListValue> list); | 42 std::unique_ptr<base::ListValue> list); |
| 43 | 43 |
| 44 Profile* profile_; // Weak pointer. | 44 Profile* profile_; // Weak pointer. |
| 45 | 45 |
| 46 base::WeakPtrFactory<FontHandler> weak_ptr_factory_; | 46 base::WeakPtrFactory<FontHandler> weak_ptr_factory_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(FontHandler); | 48 DISALLOW_COPY_AND_ASSIGN(FontHandler); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace settings | 51 } // namespace settings |
| 52 | 52 |
| 53 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ | 53 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_FONT_HANDLER_H_ |
| OLD | NEW |