Skip to content

Commit

Permalink
[iOS] Expose histograms internal web view
Browse files Browse the repository at this point in the history
This will allow us to add find-in page on the iOS side to help QA test P3A related tickets
  • Loading branch information
kylehickinson committed Oct 5, 2023
1 parent d393e00 commit 6adefb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ios/browser/api/p3a/brave_histograms_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>

NS_ASSUME_NONNULL_BEGIN

/// Displays the `chrome://histograms` web page to verify P3A histograms
OBJC_EXPORT
@interface BraveHistogramsController : UIViewController
@property(readonly) WKWebView* webView;
- (instancetype)init NS_UNAVAILABLE;
@end

Expand Down
4 changes: 4 additions & 0 deletions ios/browser/api/p3a/brave_histograms_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ - (instancetype)initWithBrowserState:(ChromeBrowserState*)mainBrowserState {
return self;
}

- (WKWebView*)webView {
return _webView;
}

- (void)dealloc {
[[_webController view] removeFromSuperview];
_webController = nullptr;
Expand Down

0 comments on commit 6adefb3

Please sign in to comment.