blob: 6383f31af4e025bec350773a8346ae327b0580cb [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2016 The Chromium Authors
[email protected]94b8a51a2014-03-26 20:57:552// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
rdevlin.cronin7138b37e2016-05-18 17:23:555#ifndef CHROME_BROWSER_UI_EXTENSIONS_SETTINGS_API_BUBBLE_HELPERS_H_
6#define CHROME_BROWSER_UI_EXTENSIONS_SETTINGS_API_BUBBLE_HELPERS_H_
[email protected]94b8a51a2014-03-26 20:57:557
Devlin Cronina997c8e2021-03-18 00:33:188#include "base/auto_reset.h"
pkastingda6dd842016-02-24 15:26:599#include "components/omnibox/browser/autocomplete_match.h"
10
[email protected]94b8a51a2014-03-26 20:57:5511class Browser;
Devlin Cronina997c8e2021-03-18 00:33:1812class PrefRegistrySimple;
13class Profile;
[email protected]94b8a51a2014-03-26 20:57:5514
15namespace content {
[email protected]94b8a51a2014-03-26 20:57:5516class WebContents;
17}
18
19namespace extensions {
20
Devlin Cronina997c8e2021-03-18 00:33:1821extern const char kNtpOverridingExtensionAcknowledged[];
22
Devlin Cronin5739bf02020-05-15 00:38:3823// Sets whether the NTP post-install UI is enabled for testing purposes.
24// TODO(devlin): This would be cooler as a base::AutoReset<>.
25void SetNtpPostInstallUiEnabledForTesting(bool enabled);
rdevlin.cronin81d35162017-05-31 15:44:4826
Devlin Cronina997c8e2021-03-18 00:33:1827// Testing-only method to configure if existing NTP extensions are
28// auto-acknowledged.
29base::AutoReset<bool> SetAcknowledgeExistingNtpExtensionsForTesting(
30 bool should_acknowledge);
31
32// Registers prefs related to the settings overridden UI.
33void RegisterSettingsOverriddenUiPrefs(PrefRegistrySimple* registry);
34
35// Iterates over existing NTP-overriding extensions installed in the given
36// `profile` and marks them as acknowledged. Stores a preference indicating
37// the action was completed. Subsequent calls will *not* acknowledge more
38// extensions. This is needed to avoid prompting users with existing
39// extensions when we expand the warning to new platforms.
40void AcknowledgePreExistingNtpExtensions(Profile* profile);
41
[email protected]94b8a51a2014-03-26 20:57:5542// Shows a bubble notifying the user that the homepage is controlled by an
43// extension. This bubble is shown only on the first use of the Home button
44// after the controlling extension takes effect.
45void MaybeShowExtensionControlledHomeNotification(Browser* browser);
46
47// Shows a bubble notifying the user that the search engine is controlled by an
48// extension. This bubble is shown only on the first search after the
49// controlling extension takes effect.
50void MaybeShowExtensionControlledSearchNotification(
[email protected]94b8a51a2014-03-26 20:57:5551 content::WebContents* web_contents,
pkastingda6dd842016-02-24 15:26:5952 AutocompleteMatch::Type match_type);
[email protected]94b8a51a2014-03-26 20:57:5553
[email protected]fbb597f2014-04-29 14:28:1454// Shows a bubble notifying the user that the new tab page is controlled by an
55// extension. This bubble is shown only the first time the new tab page is shown
56// after the controlling extension takes effect.
Peter Kastinga4863242024-12-23 00:19:4357void MaybeShowExtensionControlledNewTabPage(Browser* browser,
58 content::WebContents* web_contents);
[email protected]fbb597f2014-04-29 14:28:1459
[email protected]94b8a51a2014-03-26 20:57:5560} // namespace extensions
61
rdevlin.cronin7138b37e2016-05-18 17:23:5562#endif // CHROME_BROWSER_UI_EXTENSIONS_SETTINGS_API_BUBBLE_HELPERS_H_