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

Unified Diff: components/search_engines/desktop_search_redirection_infobar_delegate.h

Issue 1598553003: Implement the Windows desktop search redirection feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build errors due to prefs being moved in components Created 4 years, 11 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: components/search_engines/desktop_search_redirection_infobar_delegate.h
diff --git a/components/search_engines/desktop_search_redirection_infobar_delegate.h b/components/search_engines/desktop_search_redirection_infobar_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..bccb77a76084f848d34e486bd3b118a39e628b06
--- /dev/null
+++ b/components/search_engines/desktop_search_redirection_infobar_delegate.h
@@ -0,0 +1,56 @@
+// 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.
+
+#ifndef COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_H_
+#define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "components/infobars/core/confirm_infobar_delegate.h"
+
+class PrefService;
+
+namespace infobars {
+class InfoBarManager;
+} // namespace infobars
+
+// Informs the user that a desktop search has been redirected to the default
+// search engine.
+class DesktopSearchRedirectionInfobarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ // Creates a search redirection infobar and delegate and adds the infobar to
+ // |infobar_manager|. Records in |pref_service| that such an infobar was
+ // shown. |default_search_engine_name| is the name of the default search
+ // engine. |manage_search_settings_callback| should open the search settings
+ // page.
+ static void Show(infobars::InfoBarManager* infobar_manager,
+ const base::string16& default_search_engine_name,
+ const base::Closure& manage_search_settings_callback,
+ PrefService* pref_service);
+
+ private:
+ DesktopSearchRedirectionInfobarDelegate(
+ const base::string16& default_search_engine_name,
+ const base::Closure& manage_search_settings_callback);
+ ~DesktopSearchRedirectionInfobarDelegate() override;
+
+ // ConfirmInfoBarDelegate:
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
+ void InfoBarDismissed() override;
+ base::string16 GetMessageText() const override;
+ int GetButtons() const override;
+ base::string16 GetButtonLabel(InfoBarButton button) const override;
+ bool Accept() override;
+
+ base::string16 default_search_engine_name_;
+ base::Closure manage_search_settings_callback_;
+
+ // True when the infobar has been closed explicitly by the user.
+ bool closed_by_user_;
+
+ DISALLOW_COPY_AND_ASSIGN(DesktopSearchRedirectionInfobarDelegate);
+};
+
+#endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_H_
« no previous file with comments | « components/search_engines/DEPS ('k') | components/search_engines/desktop_search_redirection_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698