blob: a9e45e7b2c00ecf680f49dfa80868097dd96d629 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <UIKit/UIKit.h>
#include "base/macros.h"
@protocol ApplicationCommands;
// This data source object is used to obtain initial data to populate the fields
// on the User Feedback form.
@protocol UserFeedbackDataSource<NSObject>
// Returns whether user was viewing a tab in Incognito mode.
- (BOOL)currentPageIsIncognito;
// Returns a formatted string representation of the URL that the user was
// viewing. May return nil if the tab viewed does not have a valid URL to be
// shown (e.g. user was viewing stack view controller).
- (NSString*)currentPageDisplayURL;
// Returns a screenshot of the application suitable for attaching to problem
// reports submitted via Send Feedback UI.
// Screenshot is taken lazily only when needed.
- (UIImage*)currentPageScreenshot;
// Returns the username of the account being synced.
// Returns nil if sync is not enabled or user is in incognito mode.
- (NSString*)currentPageSyncedUserName;
// UserFeedbackProvider allows embedders to provide functionality to collect
// and upload feedback reports from the user.
class UserFeedbackProvider {
virtual ~UserFeedbackProvider();
// Returns true if user feedback is enabled.
virtual bool IsUserFeedbackEnabled();
// Returns view controller to present to the user to collect their feedback.
virtual UIViewController* CreateViewController(
id<UserFeedbackDataSource> data_source);
// Uploads collected feedback reports.
virtual void Synchronize();