blob: e674917922fd8d1da3749c4906595f701ac4c239 [file] [log] [blame]
rdevlin.cronin690e44f2015-11-06 00:27:141// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_API_BUBBLE_DELEGATE_H_
6#define CHROME_BROWSER_EXTENSIONS_SETTINGS_API_BUBBLE_DELEGATE_H_
7
avia2f4804a2015-12-24 23:11:138#include <stddef.h>
9
rdevlin.cronin690e44f2015-11-06 00:27:1410#include <string>
11
12#include "base/macros.h"
13#include "chrome/browser/extensions/extension_message_bubble_controller.h"
14#include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h"
15
16namespace extensions {
17
18class SettingsApiBubbleDelegate
19 : public ExtensionMessageBubbleController::Delegate {
20 public:
21 SettingsApiBubbleDelegate(Profile* profile, SettingsApiOverrideType type);
22 ~SettingsApiBubbleDelegate() override;
23
24 // ExtensionMessageBubbleController::Delegate methods.
25 bool ShouldIncludeExtension(const Extension* extension) override;
26 void AcknowledgeExtension(
27 const std::string& extension_id,
28 ExtensionMessageBubbleController::BubbleAction user_action) override;
29 void PerformAction(const ExtensionIdList& list) override;
30 base::string16 GetTitle() const override;
31 base::string16 GetMessageBody(bool anchored_to_browser_action,
32 int extension_count) const override;
33 base::string16 GetOverflowText(
34 const base::string16& overflow_count) const override;
35 GURL GetLearnMoreUrl() const override;
36 base::string16 GetActionButtonLabel() const override;
37 base::string16 GetDismissButtonLabel() const override;
38 bool ShouldCloseOnDeactivate() const override;
rdevlin.cronincf27f866a2017-02-01 16:34:3939 bool ShouldAcknowledgeOnDeactivate() const override;
Catherine Mullings478a0432017-11-22 07:06:0640 bool ShouldShow(const ExtensionIdList& extensions) const override;
41 void OnShown(const ExtensionIdList& extensions) override;
42 void OnAction() override;
43 void ClearProfileSetForTesting() override;
rdevlin.cronin690e44f2015-11-06 00:27:1444 bool ShouldShowExtensionList() const override;
45 bool ShouldHighlightExtensions() const override;
46 bool ShouldLimitToEnabledExtensions() const override;
47 void LogExtensionCount(size_t count) override;
48 void LogAction(ExtensionMessageBubbleController::BubbleAction) override;
catmullings22bc2372016-11-02 19:59:3549 bool SupportsPolicyIndicator() override;
rdevlin.cronin690e44f2015-11-06 00:27:1450
51 private:
Catherine Mullings478a0432017-11-22 07:06:0652 // Returns a key unique to the type of bubble that can be used to retrieve
53 // state specific to the type (e.g., shown for profiles).
54 const char* GetKey() const;
rdevlin.cronin690e44f2015-11-06 00:27:1455 // The type of settings override this bubble will report on. This can be, for
56 // example, a bubble to notify the user that the search engine has been
57 // changed by an extension (or homepage/startup pages/etc).
58 SettingsApiOverrideType type_;
59
60 // The ID of the extension we are showing the bubble for.
61 std::string extension_id_;
62
Catherine Mullings478a0432017-11-22 07:06:0663 Profile* profile_;
64
rdevlin.cronin690e44f2015-11-06 00:27:1465 DISALLOW_COPY_AND_ASSIGN(SettingsApiBubbleDelegate);
66};
67
68} // namespace extensions
69
70#endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_API_BUBBLE_DELEGATE_H_