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

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

Issue 6883299: Hide translate infobar on programmatic navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 MessageLoop::current()->PostDelayedTask(FROM_HERE, 179 MessageLoop::current()->PostDelayedTask(FROM_HERE,
180 method_factory_.NewRunnableMethod( 180 method_factory_.NewRunnableMethod(
181 &DefaultBrowserInfoBarDelegate::AllowExpiry), 8000); // 8 seconds. 181 &DefaultBrowserInfoBarDelegate::AllowExpiry), 8000); // 8 seconds.
182 } 182 }
183 183
184 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() { 184 DefaultBrowserInfoBarDelegate::~DefaultBrowserInfoBarDelegate() {
185 } 185 }
186 186
187 bool DefaultBrowserInfoBarDelegate::ShouldExpire( 187 bool DefaultBrowserInfoBarDelegate::ShouldExpire(
188 const NavigationController::LoadCommittedDetails& details) const { 188 const NavigationController::LoadCommittedDetails& details) const {
189 return should_expire_; 189 return details.is_user_initiated_main_frame_load() && should_expire_;
190 } 190 }
191 191
192 void DefaultBrowserInfoBarDelegate::InfoBarClosed() { 192 void DefaultBrowserInfoBarDelegate::InfoBarClosed() {
193 if (!action_taken_) 193 if (!action_taken_)
194 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1); 194 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.Ignored", 1);
195 delete this; 195 delete this;
196 } 196 }
197 197
198 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const { 198 gfx::Image* DefaultBrowserInfoBarDelegate::GetIcon() const {
199 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 199 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
(...skipping 1192 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 return false; 1392 return false;
1393 automation->SetExpectedTabCount(expected_tabs); 1393 automation->SetExpectedTabCount(expected_tabs);
1394 1394
1395 AutomationProviderList* list = 1395 AutomationProviderList* list =
1396 g_browser_process->InitAutomationProviderList(); 1396 g_browser_process->InitAutomationProviderList();
1397 DCHECK(list); 1397 DCHECK(list);
1398 list->AddProvider(automation); 1398 list->AddProvider(automation);
1399 1399
1400 return true; 1400 return true;
1401 } 1401 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698