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

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

Issue 6926001: Replace the virtual InfoBarDelegate::InfoBarClosed() function with a non-virtual one. This is a ... (Closed) Base URL: svn://chrome-svn/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 "content/browser/geolocation/geolocation_permission_context.h" 5 #include "content/browser/geolocation/geolocation_permission_context.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 int render_process_id, 118 int render_process_id,
119 int render_view_id, 119 int render_view_id,
120 int bridge_id, 120 int bridge_id,
121 const GURL& requesting_frame_url, 121 const GURL& requesting_frame_url,
122 const std::string& display_languages); 122 const std::string& display_languages);
123 123
124 private: 124 private:
125 virtual ~GeolocationConfirmInfoBarDelegate(); 125 virtual ~GeolocationConfirmInfoBarDelegate();
126 126
127 // ConfirmInfoBarDelegate: 127 // ConfirmInfoBarDelegate:
128 virtual void InfoBarClosed(); 128 virtual gfx::Image* GetIcon() const OVERRIDE;
129 virtual gfx::Image* GetIcon() const; 129 virtual Type GetInfoBarType() const OVERRIDE;
130 virtual Type GetInfoBarType() const; 130 virtual string16 GetMessageText() const OVERRIDE;
131 virtual string16 GetMessageText() const; 131 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
132 virtual string16 GetButtonLabel(InfoBarButton button) const; 132 virtual bool Accept() OVERRIDE;
133 virtual bool Accept(); 133 virtual bool Cancel() OVERRIDE;
134 virtual bool Cancel(); 134 virtual string16 GetLinkText() OVERRIDE;
135 virtual string16 GetLinkText(); 135 virtual bool LinkClicked(WindowOpenDisposition disposition) OVERRIDE;
136 virtual bool LinkClicked(WindowOpenDisposition disposition);
137 136
138 TabContents* tab_contents_; 137 TabContents* tab_contents_;
139 GeolocationInfoBarQueueController* controller_; 138 GeolocationInfoBarQueueController* controller_;
140 int render_process_id_; 139 int render_process_id_;
141 int render_view_id_; 140 int render_view_id_;
142 int bridge_id_; 141 int bridge_id_;
143 GURL requesting_frame_url_; 142 GURL requesting_frame_url_;
144 std::string display_languages_; 143 std::string display_languages_;
145 144
146 DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationConfirmInfoBarDelegate); 145 DISALLOW_IMPLICIT_CONSTRUCTORS(GeolocationConfirmInfoBarDelegate);
(...skipping 11 matching lines...) Expand all
158 tab_contents_(tab_contents), 157 tab_contents_(tab_contents),
159 controller_(controller), 158 controller_(controller),
160 render_process_id_(render_process_id), 159 render_process_id_(render_process_id),
161 render_view_id_(render_view_id), 160 render_view_id_(render_view_id),
162 bridge_id_(bridge_id), 161 bridge_id_(bridge_id),
163 requesting_frame_url_(requesting_frame_url), 162 requesting_frame_url_(requesting_frame_url),
164 display_languages_(display_languages) { 163 display_languages_(display_languages) {
165 } 164 }
166 165
167 GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() { 166 GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() {
168 }
169
170 void GeolocationConfirmInfoBarDelegate::InfoBarClosed() {
171 controller_->OnInfoBarClosed(render_process_id_, render_view_id_, 167 controller_->OnInfoBarClosed(render_process_id_, render_view_id_,
172 bridge_id_); 168 bridge_id_);
173 delete this;
174 } 169 }
175 170
176 gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const { 171 gfx::Image* GeolocationConfirmInfoBarDelegate::GetIcon() const {
177 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( 172 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed(
178 IDR_GEOLOCATION_INFOBAR_ICON); 173 IDR_GEOLOCATION_INFOBAR_ICON);
179 } 174 }
180 175
181 InfoBarDelegate::Type 176 InfoBarDelegate::Type
182 GeolocationConfirmInfoBarDelegate::GetInfoBarType() const { 177 GeolocationConfirmInfoBarDelegate::GetInfoBarType() const {
183 return PAGE_ACTION_TYPE; 178 return PAGE_ACTION_TYPE;
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 615 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
621 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod( 616 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, NewRunnableMethod(
622 this, &GeolocationPermissionContext::CancelPendingInfoBarRequest, 617 this, &GeolocationPermissionContext::CancelPendingInfoBarRequest,
623 render_process_id, render_view_id, bridge_id)); 618 render_process_id, render_view_id, bridge_id));
624 return; 619 return;
625 } 620 }
626 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 621 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
627 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, 622 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id,
628 render_view_id, bridge_id); 623 render_view_id, bridge_id);
629 } 624 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/theme_installed_infobar_delegate.cc ('k') | chrome/browser/google/google_url_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698