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

Unified Diff: components/search_engines/desktop_search_infobar_delegate_win.h

Issue 1598553003: Implement the Windows desktop search redirection feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_infobar_delegate_win.h
diff --git a/components/search_engines/desktop_search_infobar_delegate_win.h b/components/search_engines/desktop_search_infobar_delegate_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..b9c8ae53192d359126aed9ed22325097ec50c4da
--- /dev/null
+++ b/components/search_engines/desktop_search_infobar_delegate_win.h
@@ -0,0 +1,58 @@
+// 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_WIN_H_
+#define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_
+
+#include "base/gtest_prod_util.h"
+#include "base/macros.h"
+#include "base/strings/string16.h"
+#include "components/infobars/core/confirm_infobar_delegate.h"
+#include "url/gurl.h"
+
+namespace infobars {
+class InfoBarManager;
+} // namespace infobars
+
+// The delegate for the infobar informing the user that a Windows desktop search
+// has been redirected to the default search engine.
+class WindowsDesktopSearchInfobarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ // Adds to |infobar_manager| an infobar informing the user that a Windows
+ // desktop search has been redirected to the default search engine.
+ // |default_search_engine_name| is the name of the default search engine.
+ // |search_settings_url| is the URL of the search settings.
+ static void Show(infobars::InfoBarManager* infobar_manager,
+ const base::string16& default_search_engine_name,
+ const GURL& search_settings_url);
+
+ private:
+ FRIEND_TEST_ALL_PREFIXES(WindowsDesktopSearchInfobarDelegateTest,
+ ManageSearchSettings);
+
+ WindowsDesktopSearchInfobarDelegate(
+ const base::string16& default_search_engine_name,
+ const GURL& search_settings_url);
+ virtual ~WindowsDesktopSearchInfobarDelegate();
+
+ // ConfirmInfoBarDelegate:
+ base::string16 GetMessageText() const override;
+ int GetButtons() const override;
+ base::string16 GetButtonLabel(InfoBarButton button) const override;
+ bool Accept() override;
+
+ // infobars::InfoBarDelegate:
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
+ void InfoBarDismissed() override;
+
+ base::string16 default_search_engine_name_;
+ GURL search_settings_url_;
+
+ // True when the infobar has been closed by clicking on the close button.
+ bool closed_by_user_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowsDesktopSearchInfobarDelegate);
+};
+
+#endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698