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

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: don't assume that a Browser exists + fix nits 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 class PrefService;
15
16 namespace infobars {
17 class InfoBarManager;
18 } // namespace infobars
19
20 // The delegate for the infobar informing the user that a Windows desktop search
Peter Kasting 2016/01/20 03:03:01 Nit: I'd probably just say "Informs the user that.
fdoray 2016/01/21 21:02:33 Done.
21 // has been redirected to the default search engine.
22 class WindowsDesktopSearchInfobarDelegate : public ConfirmInfoBarDelegate {
23 public:
24 // Adds to |infobar_manager| an infobar informing the user that a Windows
25 // desktop search has been redirected to the default search engine.
26 // |default_search_engine_name| is the name of the default search engine.
27 // |search_settings_url| is the URL of the search settings. The function
28 // records in |pref_service| that the infobar has been shown.
Peter Kasting 2016/01/20 03:03:01 Nit: Simpler, and more parallel to other infobars'
fdoray 2016/01/21 21:02:33 Done.
29 static void Show(infobars::InfoBarManager* infobar_manager,
30 const base::string16& default_search_engine_name,
31 const GURL& search_settings_url,
32 PrefService* pref_service);
33
34 private:
35 FRIEND_TEST_ALL_PREFIXES(WindowsDesktopSearchInfobarDelegateTest,
36 ManageSearchSettings);
37
38 WindowsDesktopSearchInfobarDelegate(
39 const base::string16& default_search_engine_name,
40 const GURL& search_settings_url);
41 virtual ~WindowsDesktopSearchInfobarDelegate();
42
43 // ConfirmInfoBarDelegate:
Peter Kasting 2016/01/20 03:03:01 It seems like we really ought to have a Learn More
fdoray 2016/01/21 21:02:33 UI review decided not to have an option to disable
Peter Kasting 2016/01/22 00:38:57 Fair enough. Make sure you ultimately remove any
44 base::string16 GetMessageText() const override;
45 int GetButtons() const override;
46 base::string16 GetButtonLabel(InfoBarButton button) const override;
47 bool Accept() override;
48
49 // infobars::InfoBarDelegate:
Peter Kasting 2016/01/20 03:03:01 You don't directly subclass this class, so these o
fdoray 2016/01/21 21:02:33 Done.
50 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
51 void InfoBarDismissed() override;
52
53 base::string16 default_search_engine_name_;
54 GURL search_settings_url_;
55
56 // True when the infobar has been closed by clicking on the close button.
57 bool closed_by_user_;
58
59 DISALLOW_COPY_AND_ASSIGN(WindowsDesktopSearchInfobarDelegate);
60 };
61
62 #endif // COMPONENTS_SEARCH_ENGINES_DESKTOP_SEARCH_INFOBAR_DELEGATE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698