OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 5 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 public: | 61 public: |
62 // Creates a default browser infobar and delegate and adds the infobar to | 62 // Creates a default browser infobar and delegate and adds the infobar to |
63 // |infobar_service|. | 63 // |infobar_service|. |
64 static void Create(InfoBarService* infobar_service, | 64 static void Create(InfoBarService* infobar_service, |
65 PrefService* prefs, | 65 PrefService* prefs, |
66 bool interactive_flow_required); | 66 bool interactive_flow_required); |
67 | 67 |
68 private: | 68 private: |
69 DefaultBrowserInfoBarDelegate(PrefService* prefs, | 69 DefaultBrowserInfoBarDelegate(PrefService* prefs, |
70 bool interactive_flow_required); | 70 bool interactive_flow_required); |
71 virtual ~DefaultBrowserInfoBarDelegate(); | 71 ~DefaultBrowserInfoBarDelegate() override; |
72 | 72 |
73 void AllowExpiry() { should_expire_ = true; } | 73 void AllowExpiry() { should_expire_ = true; } |
74 | 74 |
75 // ConfirmInfoBarDelegate: | 75 // ConfirmInfoBarDelegate: |
76 virtual int GetIconID() const override; | 76 int GetIconID() const override; |
77 virtual base::string16 GetMessageText() const override; | 77 base::string16 GetMessageText() const override; |
78 virtual base::string16 GetButtonLabel(InfoBarButton button) const override; | 78 base::string16 GetButtonLabel(InfoBarButton button) const override; |
79 virtual bool OKButtonTriggersUACPrompt() const override; | 79 bool OKButtonTriggersUACPrompt() const override; |
80 virtual bool Accept() override; | 80 bool Accept() override; |
81 virtual bool Cancel() override; | 81 bool Cancel() override; |
82 virtual bool ShouldExpireInternal( | 82 bool ShouldExpireInternal(const NavigationDetails& details) const override; |
83 const NavigationDetails& details) const override; | |
84 | 83 |
85 // The prefs to use. | 84 // The prefs to use. |
86 PrefService* prefs_; | 85 PrefService* prefs_; |
87 | 86 |
88 // Whether the user clicked one of the buttons. | 87 // Whether the user clicked one of the buttons. |
89 bool action_taken_; | 88 bool action_taken_; |
90 | 89 |
91 // Whether the info-bar should be dismissed on the next navigation. | 90 // Whether the info-bar should be dismissed on the next navigation. |
92 bool should_expire_; | 91 bool should_expire_; |
93 | 92 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::Bind(&CheckDefaultBrowserCallback, desktop_type)); | 256 base::Bind(&CheckDefaultBrowserCallback, desktop_type)); |
258 } | 257 } |
259 | 258 |
260 #if !defined(OS_WIN) | 259 #if !defined(OS_WIN) |
261 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 260 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
262 return false; | 261 return false; |
263 } | 262 } |
264 #endif | 263 #endif |
265 | 264 |
266 } // namespace chrome | 265 } // namespace chrome |
OLD | NEW |