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

Side by Side 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, 10 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_H_
6 #define COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/strings/string16.h"
11 #include "components/infobars/core/confirm_infobar_delegate.h"
12
13 class PrefService;
14
15 namespace infobars {
16 class InfoBarManager;
17 } // namespace infobars
18
19 // Informs the user that a desktop search has been redirected to the default
20 // search engine.
21 class DesktopSearchRedirectionInfobarDelegate : public ConfirmInfoBarDelegate {
22 public:
23 // Creates a search redirection infobar and delegate and adds the infobar to
24 // |infobar_manager|. Records in |pref_service| that such an infobar was
25 // shown. |default_search_engine_name| is the name of the default search
26 // engine. |manage_search_settings_callback| should open the search settings
27 // page.
28 static void Show(infobars::InfoBarManager* infobar_manager,
29 const base::string16& default_search_engine_name,
30 const base::Closure& manage_search_settings_callback,
31 PrefService* pref_service);
32
33 private:
34 DesktopSearchRedirectionInfobarDelegate(
35 const base::string16& default_search_engine_name,
36 const base::Closure& manage_search_settings_callback);
37 ~DesktopSearchRedirectionInfobarDelegate() override;
38
39 // ConfirmInfoBarDelegate:
40 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
41 void InfoBarDismissed() override;
42 base::string16 GetMessageText() const override;
43 int GetButtons() const override;
44 base::string16 GetButtonLabel(InfoBarButton button) const override;
45 bool Accept() override;
46
47 base::string16 default_search_engine_name_;
48 base::Closure manage_search_settings_callback_;
49
50 // True when the infobar has been closed explicitly by the user.
51 bool closed_by_user_;
52
53 DISALLOW_COPY_AND_ASSIGN(DesktopSearchRedirectionInfobarDelegate);
54 };
55
56 #endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_H_
OLDNEW
« 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