| 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_MD_HISTORY_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_MD_HISTORY_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_MD_HISTORY_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_MD_HISTORY_UI_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "content/public/browser/web_ui_controller.h" | 10 #include "content/public/browser/web_ui_controller.h" |
| 11 #include "ui/base/layout.h" | 11 #include "ui/base/layout.h" |
| 12 | 12 |
| 13 class Profile; | 13 class Profile; |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class ListValue; | 16 class ListValue; |
| 17 class RefCountedMemory; | 17 class RefCountedMemory; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | |
| 21 class WebUIDataSource; | |
| 22 } | |
| 23 | 20 |
| 24 namespace user_prefs { | 21 namespace user_prefs { |
| 25 class PrefRegistrySyncable; | 22 class PrefRegistrySyncable; |
| 26 } | 23 } |
| 27 | 24 |
| 28 class MdHistoryUI : public content::WebUIController { | 25 class MdHistoryUI : public content::WebUIController { |
| 29 public: | 26 public: |
| 30 explicit MdHistoryUI(content::WebUI* web_ui); | 27 explicit MdHistoryUI(content::WebUI* web_ui); |
| 31 ~MdHistoryUI() override; | 28 ~MdHistoryUI() override; |
| 32 | 29 |
| 33 static bool IsEnabled(Profile* profile); | 30 static bool IsEnabled(Profile* profile); |
| 34 | 31 |
| 35 // Reset the current list of features and explicitly set MD History enabled. | 32 // Reset the current list of features and explicitly set MD History enabled. |
| 36 static void SetEnabledForTesting(bool enabled); | 33 static void SetEnabledForTesting(bool enabled); |
| 37 | 34 |
| 38 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 35 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 39 | 36 |
| 40 static base::RefCountedMemory* GetFaviconResourceBytes( | 37 static base::RefCountedMemory* GetFaviconResourceBytes( |
| 41 ui::ScaleFactor scale_factor); | 38 ui::ScaleFactor scale_factor); |
| 42 | 39 |
| 43 private: | 40 private: |
| 44 FRIEND_TEST_ALL_PREFIXES(ContinueWhereILeftOffTest, MDHistoryUpgrade); | 41 FRIEND_TEST_ALL_PREFIXES(ContinueWhereILeftOffTest, MDHistoryUpgrade); |
| 45 | 42 |
| 46 static bool use_test_title_; | 43 static bool use_test_title_; |
| 47 | 44 |
| 45 void CreateDataSource(); |
| 46 |
| 48 // Handler for the "menuPromoShown" message from the page. No arguments. | 47 // Handler for the "menuPromoShown" message from the page. No arguments. |
| 49 void HandleMenuPromoShown(const base::ListValue* args); | 48 void HandleMenuPromoShown(const base::ListValue* args); |
| 50 | 49 |
| 51 content::WebUIDataSource* data_source_; // weak | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(MdHistoryUI); | 50 DISALLOW_COPY_AND_ASSIGN(MdHistoryUI); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 #endif // CHROME_BROWSER_UI_WEBUI_MD_HISTORY_UI_H_ | 53 #endif // CHROME_BROWSER_UI_WEBUI_MD_HISTORY_UI_H_ |
| OLD | NEW |