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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 7205026: Don't rely on user gestures for deciding when to dismiss infobars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | Annotate | Revision Log
OLDNEW
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
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 content::LoadCommittedDetails& details) const { 189 const content::LoadCommittedDetails& details) const {
190 return details.is_user_initiated_main_frame_load() && should_expire_; 190 return details.is_navigation_to_different_page() && 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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 return false; 1423 return false;
1424 automation->SetExpectedTabCount(expected_tabs); 1424 automation->SetExpectedTabCount(expected_tabs);
1425 1425
1426 AutomationProviderList* list = 1426 AutomationProviderList* list =
1427 g_browser_process->InitAutomationProviderList(); 1427 g_browser_process->InitAutomationProviderList();
1428 DCHECK(list); 1428 DCHECK(list);
1429 list->AddProvider(automation); 1429 list->AddProvider(automation);
1430 1430
1431 return true; 1431 return true;
1432 } 1432 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.cc ('k') | chrome/browser/ui/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698