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

Side by Side Diff: chrome/browser/omnibox_search_hint.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 | « no previous file | chrome/browser/tab_contents/confirm_infobar_delegate.h » ('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/omnibox_search_hint.h" 5 #include "chrome/browser/omnibox_search_hint.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/task.h" 9 #include "base/task.h"
10 // TODO(avi): remove when conversions not needed any more 10 // TODO(avi): remove when conversions not needed any more
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 8000); // 8 seconds. 95 8000); // 8 seconds.
96 } 96 }
97 97
98 HintInfoBar::~HintInfoBar() { 98 HintInfoBar::~HintInfoBar() {
99 if (!action_taken_) 99 if (!action_taken_)
100 UMA_HISTOGRAM_COUNTS("OmniboxSearchHint.Ignored", 1); 100 UMA_HISTOGRAM_COUNTS("OmniboxSearchHint.Ignored", 1);
101 } 101 }
102 102
103 bool HintInfoBar::ShouldExpire( 103 bool HintInfoBar::ShouldExpire(
104 const content::LoadCommittedDetails& details) const { 104 const content::LoadCommittedDetails& details) const {
105 return details.is_navigation_to_different_page() && should_expire_; 105 return details.is_user_initiated_main_frame_load() && should_expire_;
106 } 106 }
107 107
108 void HintInfoBar::InfoBarDismissed() { 108 void HintInfoBar::InfoBarDismissed() {
109 action_taken_ = true; 109 action_taken_ = true;
110 UMA_HISTOGRAM_COUNTS("OmniboxSearchHint.Closed", 1); 110 UMA_HISTOGRAM_COUNTS("OmniboxSearchHint.Closed", 1);
111 // User closed the infobar, let's not bug him again with this in the future. 111 // User closed the infobar, let's not bug him again with this in the future.
112 omnibox_hint_->DisableHint(); 112 omnibox_hint_->DisableHint();
113 } 113 }
114 114
115 gfx::Image* HintInfoBar::GetIcon() const { 115 gfx::Image* HintInfoBar::GetIcon() const {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 227
228 // static 228 // static
229 bool OmniboxSearchHint::IsEnabled(Profile* profile) { 229 bool OmniboxSearchHint::IsEnabled(Profile* profile) {
230 // The infobar can only be shown if the correct switch has been provided and 230 // The infobar can only be shown if the correct switch has been provided and
231 // the user did not dismiss the infobar before. 231 // the user did not dismiss the infobar before.
232 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) && 232 return profile->GetPrefs()->GetBoolean(prefs::kShowOmniboxSearchHint) &&
233 CommandLine::ForCurrentProcess()->HasSwitch( 233 CommandLine::ForCurrentProcess()->HasSwitch(
234 switches::kSearchInOmniboxHint); 234 switches::kSearchInOmniboxHint);
235 } 235 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/confirm_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698