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 IOS_CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ |
6 #define IOS_CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_ | 6 #define IOS_CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
9 #include "ios/public/provider/web/web_ui_ios_controller.h" | 10 #include "ios/public/provider/web/web_ui_ios_controller.h" |
10 #include "ui/base/layout.h" | 11 #include "ui/base/layout.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class RefCountedMemory; | 14 class RefCountedMemory; |
14 } | 15 } |
15 | 16 |
16 namespace web { | 17 class BaseFlagsUI : public web::WebUIIOSController { |
17 class WebUIIOS; | 18 public: |
18 } | 19 enum FlagsUIKind { |
| 20 FLAGS_UI_GENERIC, |
| 21 FLAGS_UI_APPLE, |
| 22 }; |
19 | 23 |
20 class CrashesUI : public web::WebUIIOSController { | 24 BaseFlagsUI(web::WebUIIOS* web_ui, FlagsUIKind flags_ui_kind); |
21 public: | 25 ~BaseFlagsUI() override; |
22 explicit CrashesUI(web::WebUIIOS* web_ui); | |
23 | 26 |
24 static base::RefCountedMemory* GetFaviconResourceBytes( | 27 static base::RefCountedMemory* GetFaviconResourceBytes( |
25 ui::ScaleFactor scale_factor); | 28 ui::ScaleFactor scale_factor); |
26 | 29 |
27 private: | 30 private: |
28 DISALLOW_COPY_AND_ASSIGN(CrashesUI); | 31 void Initialize(web::WebUIIOS* web_ui, FlagsUIKind flags_ui_kind); |
| 32 |
| 33 base::WeakPtrFactory<BaseFlagsUI> weak_factory_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(BaseFlagsUI); |
29 }; | 36 }; |
30 | 37 |
31 #endif // CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_ | 38 class FlagsUI : public BaseFlagsUI { |
| 39 public: |
| 40 explicit FlagsUI(web::WebUIIOS* web_ui); |
| 41 ~FlagsUI() override; |
| 42 |
| 43 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(FlagsUI); |
| 45 }; |
| 46 |
| 47 class AppleFlagsUI : public BaseFlagsUI { |
| 48 public: |
| 49 explicit AppleFlagsUI(web::WebUIIOS* web_ui); |
| 50 ~AppleFlagsUI() override; |
| 51 |
| 52 private: |
| 53 DISALLOW_COPY_AND_ASSIGN(AppleFlagsUI); |
| 54 }; |
| 55 |
| 56 #endif // IOS_CHROME_BROWSER_UI_WEBUI_FLAGS_UI_H_ |
OLD | NEW |