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

Side by Side Diff: chrome/browser/translate/translate_infobar_delegate.cc

Issue 7324001: Revert 89864 - 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, 5 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
« no previous file with comments | « chrome/browser/tab_contents/infobar_delegate.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/translate/translate_infobar_delegate.h" 5 #include "chrome/browser/translate/translate_infobar_delegate.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 if (language_code == target_language) 352 if (language_code == target_language)
353 target_language_index_ = iter - languages_.begin(); 353 target_language_index_ = iter - languages_.begin();
354 } 354 }
355 } 355 }
356 356
357 bool TranslateInfoBarDelegate::ShouldExpire( 357 bool TranslateInfoBarDelegate::ShouldExpire(
358 const content::LoadCommittedDetails& details) const { 358 const content::LoadCommittedDetails& details) const {
359 // Note: we allow closing this infobar even if the main frame navigation 359 // Note: we allow closing this infobar even if the main frame navigation
360 // was programmatic and not initiated by the user - crbug.com/70261 . 360 // was programmatic and not initiated by the user - crbug.com/70261 .
361 if (!details.is_navigation_to_different_page() && !details.is_main_frame) 361 if (!details.is_user_initiated_main_frame_load() && !details.is_main_frame)
362 return false; 362 return false;
363 363
364 return InfoBarDelegate::ShouldExpireInternal(details); 364 return InfoBarDelegate::ShouldExpireInternal(details);
365 } 365 }
366 366
367 void TranslateInfoBarDelegate::InfoBarDismissed() { 367 void TranslateInfoBarDelegate::InfoBarDismissed() {
368 if (type_ != BEFORE_TRANSLATE) 368 if (type_ != BEFORE_TRANSLATE)
369 return; 369 return;
370 370
371 // The user closed the infobar without clicking the translate button. 371 // The user closed the infobar without clicking the translate button.
(...skipping 12 matching lines...) Expand all
384 384
385 TranslateInfoBarDelegate* 385 TranslateInfoBarDelegate*
386 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() { 386 TranslateInfoBarDelegate::AsTranslateInfoBarDelegate() {
387 return this; 387 return this;
388 } 388 }
389 389
390 std::string TranslateInfoBarDelegate::GetPageHost() { 390 std::string TranslateInfoBarDelegate::GetPageHost() {
391 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry(); 391 NavigationEntry* entry = tab_contents_->controller().GetActiveEntry();
392 return entry ? entry->url().HostNoBrackets() : std::string(); 392 return entry ? entry->url().HostNoBrackets() : std::string();
393 } 393 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/infobar_delegate.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698