| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 NUM_INFO_BAR_USER_INTERACTION_TYPES | 57 NUM_INFO_BAR_USER_INTERACTION_TYPES |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 explicit DefaultBrowserInfoBarDelegate(PrefService* prefs); | 60 explicit DefaultBrowserInfoBarDelegate(PrefService* prefs); |
| 61 ~DefaultBrowserInfoBarDelegate() override; | 61 ~DefaultBrowserInfoBarDelegate() override; |
| 62 | 62 |
| 63 void AllowExpiry() { should_expire_ = true; } | 63 void AllowExpiry() { should_expire_ = true; } |
| 64 | 64 |
| 65 // ConfirmInfoBarDelegate: | 65 // ConfirmInfoBarDelegate: |
| 66 Type GetInfoBarType() const override; | 66 Type GetInfoBarType() const override; |
| 67 std::string GetIdentifier() const override; |
| 67 int GetIconId() const override; | 68 int GetIconId() const override; |
| 68 gfx::VectorIconId GetVectorIconId() const override; | 69 gfx::VectorIconId GetVectorIconId() const override; |
| 69 bool ShouldExpire(const NavigationDetails& details) const override; | 70 bool ShouldExpire(const NavigationDetails& details) const override; |
| 70 base::string16 GetMessageText() const override; | 71 base::string16 GetMessageText() const override; |
| 71 base::string16 GetButtonLabel(InfoBarButton button) const override; | 72 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 72 bool OKButtonTriggersUACPrompt() const override; | 73 bool OKButtonTriggersUACPrompt() const override; |
| 73 bool Accept() override; | 74 bool Accept() override; |
| 74 bool Cancel() override; | 75 bool Cancel() override; |
| 75 | 76 |
| 76 // The prefs to use. | 77 // The prefs to use. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 120 |
| 120 infobars::InfoBarDelegate::Type DefaultBrowserInfoBarDelegate::GetInfoBarType() | 121 infobars::InfoBarDelegate::Type DefaultBrowserInfoBarDelegate::GetInfoBarType() |
| 121 const { | 122 const { |
| 122 #if defined(OS_WIN) | 123 #if defined(OS_WIN) |
| 123 return WARNING_TYPE; | 124 return WARNING_TYPE; |
| 124 #else | 125 #else |
| 125 return PAGE_ACTION_TYPE; | 126 return PAGE_ACTION_TYPE; |
| 126 #endif | 127 #endif |
| 127 } | 128 } |
| 128 | 129 |
| 130 std::string DefaultBrowserInfoBarDelegate::GetIdentifier() const { |
| 131 return "DefaultBrowserInfoBarDelegate"; |
| 132 } |
| 133 |
| 129 int DefaultBrowserInfoBarDelegate::GetIconId() const { | 134 int DefaultBrowserInfoBarDelegate::GetIconId() const { |
| 130 return IDR_PRODUCT_LOGO_32; | 135 return IDR_PRODUCT_LOGO_32; |
| 131 } | 136 } |
| 132 | 137 |
| 133 gfx::VectorIconId DefaultBrowserInfoBarDelegate::GetVectorIconId() const { | 138 gfx::VectorIconId DefaultBrowserInfoBarDelegate::GetVectorIconId() const { |
| 134 #if defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_IOS) | 139 #if defined(OS_MACOSX) || defined(OS_ANDROID) || defined(OS_IOS) |
| 135 return gfx::VectorIconId::VECTOR_ICON_NONE; | 140 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 136 #else | 141 #else |
| 137 return gfx::VectorIconId::CHROME_PRODUCT; | 142 return gfx::VectorIconId::CHROME_PRODUCT; |
| 138 #endif | 143 #endif |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 ->StartCheckIsDefault(); | 318 ->StartCheckIsDefault(); |
| 314 } | 319 } |
| 315 | 320 |
| 316 #if !defined(OS_WIN) | 321 #if !defined(OS_WIN) |
| 317 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 322 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
| 318 return false; | 323 return false; |
| 319 } | 324 } |
| 320 #endif | 325 #endif |
| 321 | 326 |
| 322 } // namespace chrome | 327 } // namespace chrome |
| OLD | NEW |