OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 &DefaultBrowserInfoBarDelegate::AllowExpiry), 8000); // 8 seconds. | 180 &DefaultBrowserInfoBarDelegate::AllowExpiry), 8000); // 8 seconds. |
181 } | 181 } |
182 | 182 |
183 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() { | 183 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() { |
184 if (!action_taken_) | 184 if (!action_taken_) |
185 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1); | 185 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1); |
186 } | 186 } |
187 | 187 |
188 bool DefaultBrowserInfoBarDelegate::ShouldExpire( | 188 bool DefaultBrowserInfoBarDelegate::ShouldExpire( |
189 const NavigationController::LoadCommittedDetails& details) const { | 189 const NavigationController::LoadCommittedDetails& details) const { |
190 return should_expire_; | 190 return details.is_user_initiated_main_frame_load() && should_expire_; |
191 } | 191 } |
192 | 192 |
193 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const { | 193 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const { |
194 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 194 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
195 IDR_PRODUCT_ICON_32); | 195 IDR_PRODUCT_ICON_32); |
196 } | 196 } |
197 | 197 |
198 string16 DefaultBrowserInfoBarDelegate::GetMessageText() const { | 198 string16 DefaultBrowserInfoBarDelegate::GetMessageText() const { |
199 return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT); | 199 return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT); |
200 } | 200 } |
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1398 return false; | 1398 return false; |
1399 automation->SetExpectedTabCount(expected_tabs); | 1399 automation->SetExpectedTabCount(expected_tabs); |
1400 | 1400 |
1401 AutomationProviderList* list = | 1401 AutomationProviderList* list = |
1402 g_browser_process->InitAutomationProviderList(); | 1402 g_browser_process->InitAutomationProviderList(); |
1403 DCHECK(list); | 1403 DCHECK(list); |
1404 list->AddProvider(automation); | 1404 list->AddProvider(automation); |
1405 | 1405 |
1406 return true; | 1406 return true; |
1407 } | 1407 } |
OLD | NEW |