Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6120)

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h

Issue 1724733002: Show a warning bubble when the IME extension is activated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix patch conflict. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
index d575cffd596fc7c7f89c166fa25e8b58c06b1925..011015e56ae1402a8defb0580c5c4d51cb4061b9 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.h
@@ -15,6 +15,15 @@ namespace input_method {
class InputMethodEngine;
} // namespace input_method
+// The status indicates whether the permission has been granted or denied when
+// the IME warning bubble has been closed.
+enum class ImeWarningBubblePermissionStatus {
+ GRANTED,
+ GRANTED_AND_NEVER_SHOW,
+ DENIED,
+ ABORTED
+};
+
namespace extensions {
class InputImeEventRouterBase;
@@ -79,11 +88,21 @@ class InputImeActivateFunction : public UIThreadExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("input.ime.activate", INPUT_IME_ACTIVATE)
+ // During testing we can disable showing a warning bubble by setting this flag
+ // to true, so that the extension can be activated directly.
+ static bool disable_bubble_for_testing_;
+
protected:
~InputImeActivateFunction() override {}
// UIThreadExtensionFunction:
ResponseAction Run() override;
+
+ private:
+ // Called when the user finishes interacting with the warning bubble.
+ // |status| indicates whether the user allows or denies to activate the
+ // extension.
+ void OnPermissionBubbleFinished(ImeWarningBubblePermissionStatus status);
};
class InputImeDeactivateFunction : public UIThreadExtensionFunction {
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/extensions/api/input_ime/input_ime_api_nonchromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698