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

Side by Side Diff: chrome/browser/geolocation/geolocation_infobar_delegate.cc

Issue 56123010: [InfoBar] remove unnecesary checks from some delegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/infobars/insecure_content_infobar_delegate.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/geolocation/geolocation_infobar_delegate.h" 5 #include "chrome/browser/geolocation/geolocation_infobar_delegate.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "chrome/browser/content_settings/permission_queue_controller.h" 8 #include "chrome/browser/content_settings/permission_queue_controller.h"
9 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/browser/infobars/infobar_service.h" 10 #include "chrome/browser/infobars/infobar_service.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 bool GeolocationInfoBarDelegate::Accept() { 100 bool GeolocationInfoBarDelegate::Accept() {
101 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_ALLOW); 101 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_ALLOW);
102 set_user_has_interacted(); 102 set_user_has_interacted();
103 SetPermission(true, true); 103 SetPermission(true, true);
104 return true; 104 return true;
105 } 105 }
106 106
107 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting, 107 void GeolocationInfoBarDelegate::SetPermission(bool update_content_setting,
108 bool allowed) { 108 bool allowed) {
109 if (web_contents()) { 109 controller_->OnPermissionSet(id_, requesting_frame_,
110 GURL embedder = web_contents()->GetLastCommittedURL().GetOrigin(); 110 web_contents()->GetLastCommittedURL().GetOrigin(),
Peter Kasting 2013/11/05 19:57:52 Nit: All lines of args should begin at the same in
Miguel Garcia 2013/11/06 17:05:58 Done.
111 controller_->OnPermissionSet(id_, requesting_frame_, embedder, 111 update_content_setting, allowed);
112 update_content_setting, allowed);
113 }
114 } 112 }
115 113
116 void GeolocationInfoBarDelegate::InfoBarDismissed() { 114 void GeolocationInfoBarDelegate::InfoBarDismissed() {
117 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_DISMISS); 115 RecordUmaEvent(GEOLOCATION_INFO_BAR_DELEGATE_EVENT_DISMISS);
118 set_user_has_interacted(); 116 set_user_has_interacted();
119 SetPermission(false, false); 117 SetPermission(false, false);
120 } 118 }
121 119
122 int GeolocationInfoBarDelegate::GetIconID() const { 120 int GeolocationInfoBarDelegate::GetIconID() const {
123 return IDR_GEOLOCATION_INFOBAR_ICON; 121 return IDR_GEOLOCATION_INFOBAR_ICON;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 "https://www.google.com/support/chrome/bin/answer.py?answer=142065"; 170 "https://www.google.com/support/chrome/bin/answer.py?answer=142065";
173 #endif 171 #endif
174 172
175 web_contents()->OpenURL(content::OpenURLParams( 173 web_contents()->OpenURL(content::OpenURLParams(
176 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)), 174 google_util::AppendGoogleLocaleParam(GURL(kGeolocationLearnMoreUrl)),
177 content::Referrer(), 175 content::Referrer(),
178 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition, 176 (disposition == CURRENT_TAB) ? NEW_FOREGROUND_TAB : disposition,
179 content::PAGE_TRANSITION_LINK, false)); 177 content::PAGE_TRANSITION_LINK, false));
180 return false; // Do not dismiss the info bar. 178 return false; // Do not dismiss the info bar.
181 } 179 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/infobars/insecure_content_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698