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_ |