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

Side by Side Diff: chrome/browser/ui/startup/default_browser_prompt.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again 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
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 <string> 7 #include <string>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 NUM_INFO_BAR_USER_INTERACTION_TYPES 59 NUM_INFO_BAR_USER_INTERACTION_TYPES
60 }; 60 };
61 61
62 explicit DefaultBrowserInfoBarDelegate(PrefService* prefs); 62 explicit DefaultBrowserInfoBarDelegate(PrefService* prefs);
63 ~DefaultBrowserInfoBarDelegate() override; 63 ~DefaultBrowserInfoBarDelegate() override;
64 64
65 void AllowExpiry() { should_expire_ = true; } 65 void AllowExpiry() { should_expire_ = true; }
66 66
67 // ConfirmInfoBarDelegate: 67 // ConfirmInfoBarDelegate:
68 Type GetInfoBarType() const override; 68 Type GetInfoBarType() const override;
69 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
69 int GetIconId() const override; 70 int GetIconId() const override;
70 gfx::VectorIconId GetVectorIconId() const override; 71 gfx::VectorIconId GetVectorIconId() const override;
71 bool ShouldExpire(const NavigationDetails& details) const override; 72 bool ShouldExpire(const NavigationDetails& details) const override;
72 base::string16 GetMessageText() const override; 73 base::string16 GetMessageText() const override;
73 base::string16 GetButtonLabel(InfoBarButton button) const override; 74 base::string16 GetButtonLabel(InfoBarButton button) const override;
74 bool OKButtonTriggersUACPrompt() const override; 75 bool OKButtonTriggersUACPrompt() const override;
75 bool Accept() override; 76 bool Accept() override;
76 bool Cancel() override; 77 bool Cancel() override;
77 78
78 // The prefs to use. 79 // The prefs to use.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 122
122 infobars::InfoBarDelegate::Type DefaultBrowserInfoBarDelegate::GetInfoBarType() 123 infobars::InfoBarDelegate::Type DefaultBrowserInfoBarDelegate::GetInfoBarType()
123 const { 124 const {
124 #if defined(OS_WIN) 125 #if defined(OS_WIN)
125 return WARNING_TYPE; 126 return WARNING_TYPE;
126 #else 127 #else
127 return PAGE_ACTION_TYPE; 128 return PAGE_ACTION_TYPE;
128 #endif 129 #endif
129 } 130 }
130 131
132 infobars::InfoBarDelegate::InfoBarIdentifier
133 DefaultBrowserInfoBarDelegate::GetIdentifier() const {
134 return DEFAULT_BROWSER_INFOBAR_DELEGATE;
135 }
136
131 int DefaultBrowserInfoBarDelegate::GetIconId() const { 137 int DefaultBrowserInfoBarDelegate::GetIconId() const {
132 return IDR_PRODUCT_LOGO_32; 138 return IDR_PRODUCT_LOGO_32;
133 } 139 }
134 140
135 gfx::VectorIconId DefaultBrowserInfoBarDelegate::GetVectorIconId() const { 141 gfx::VectorIconId DefaultBrowserInfoBarDelegate::GetVectorIconId() const {
136 #if defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_IOS) 142 #if defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_IOS)
137 return gfx::VectorIconId::VECTOR_ICON_NONE; 143 return gfx::VectorIconId::VECTOR_ICON_NONE;
138 #else 144 #else
139 return gfx::VectorIconId::CHROME_PRODUCT; 145 return gfx::VectorIconId::CHROME_PRODUCT;
140 #endif 146 #endif
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 ->StartCheckIsDefault(); 321 ->StartCheckIsDefault();
316 } 322 }
317 323
318 #if !defined(OS_WIN) 324 #if !defined(OS_WIN)
319 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { 325 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) {
320 return false; 326 return false;
321 } 327 }
322 #endif 328 #endif
323 329
324 } // namespace chrome 330 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/bad_flags_prompt.cc ('k') | chrome/browser/ui/startup/google_api_keys_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698