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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_
6 #define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_
7
8 #include "base/gtest_prod_util.h"
9 #include "base/macros.h"
10 #include "base/strings/string16.h"
11 #include "components/infobars/core/confirm_infobar_delegate.h"
12 #include "url/gurl.h"
13
14 namespace infobars {
15 class InfoBarManager;
16 } // namespace infobars
17
18 // The delegate for the infobar informing the user that a Windows desktop search
19 // has been redirected to the default search engine.
20 class WindowsDesktopSearchInfobarDelegate : public ConfirmInfoBarDelegate {
21 public:
22 // Adds to |infobar_manager| an infobar informing the user that a Windows
23 // desktop search has been redirected to the default search engine.
24 // |default_search_engine_name| is the name of the default search engine.
25 // |search_settings_url| is the URL of the search settings.
26 static void Show(infobars::InfoBarManager* infobar_manager,
27 const base::string16& default_search_engine_name,
28 const GURL& search_settings_url);
29
30 private:
31 FRIEND_TEST_ALL_PREFIXES(WindowsDesktopSearchInfobarDelegateTest,
32 ManageSearchSettings);
33
34 WindowsDesktopSearchInfobarDelegate(
35 const base::string16& default_search_engine_name,
36 const GURL& search_settings_url);
37 virtual ~WindowsDesktopSearchInfobarDelegate();
38
39 // ConfirmInfoBarDelegate:
40 base::string16 GetMessageText() const override;
41 int GetButtons() const override;
42 base::string16 GetButtonLabel(InfoBarButton button) const override;
43 bool Accept() override;
44
45 // infobars::InfoBarDelegate:
46 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
47 void InfoBarDismissed() override;
48
49 base::string16 default_search_engine_name_;
50 GURL search_settings_url_;
51
52 // True when the infobar has been closed by clicking on the close button.
53 bool closed_by_user_;
54
55 DISALLOW_COPY_AND_ASSIGN(WindowsDesktopSearchInfobarDelegate);
56 };
57
58 #endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698