OLD | NEW |
---|---|
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_queue_controller.h" | 5 #include "chrome/browser/geolocation/geolocation_infobar_queue_controller.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.h" |
8 #include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate.h" | 8 #include "chrome/browser/geolocation/geolocation_confirm_infobar_delegate_factor y.h" |
9 #include "chrome/browser/infobars/infobar.h" | 9 #include "chrome/browser/infobars/infobar.h" |
10 #include "chrome/browser/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
11 #include "chrome/browser/prefs/pref_service.h" | 11 #include "chrome/browser/prefs/pref_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/tab_contents/tab_util.h" | 13 #include "chrome/browser/tab_contents/tab_util.h" |
14 #include "chrome/common/chrome_notification_types.h" | 14 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/common/content_settings.h" | 15 #include "chrome/common/content_settings.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 | 274 |
275 GeolocationConfirmInfoBarDelegate* | 275 GeolocationConfirmInfoBarDelegate* |
276 GeolocationInfoBarQueueController::CreateInfoBarDelegate( | 276 GeolocationInfoBarQueueController::CreateInfoBarDelegate( |
277 InfoBarTabHelper* infobar_helper, | 277 InfoBarTabHelper* infobar_helper, |
278 GeolocationInfoBarQueueController* controller, | 278 GeolocationInfoBarQueueController* controller, |
279 int render_process_id, | 279 int render_process_id, |
280 int render_view_id, | 280 int render_view_id, |
281 int bridge_id, | 281 int bridge_id, |
282 const GURL& requesting_frame_url, | 282 const GURL& requesting_frame_url, |
283 const std::string& display_languages) { | 283 const std::string& display_languages) { |
284 return new GeolocationConfirmInfoBarDelegate(infobar_helper, | 284 return GeolocationConfirmInfoBarDelegateFactory::Create(infobar_helper, |
bulach
2012/10/22 13:01:03
nit: calling code can be more compact, like:
retur
Ramya
2012/10/22 20:58:04
Done.
| |
285 controller, | 285 controller, |
286 render_process_id, | 286 render_process_id, |
287 render_view_id, | 287 render_view_id, |
288 bridge_id, | 288 bridge_id, |
289 requesting_frame_url, | 289 requesting_frame_url, |
290 display_languages); | 290 display_languages); |
291 } | 291 } |
292 | 292 |
293 void GeolocationInfoBarQueueController::ShowQueuedInfoBar( | 293 void GeolocationInfoBarQueueController::ShowQueuedInfoBar( |
294 int render_process_id, | 294 int render_process_id, |
295 int render_view_id, | 295 int render_view_id, |
296 InfoBarTabHelper* helper) { | 296 InfoBarTabHelper* helper) { |
297 DCHECK(helper); | 297 DCHECK(helper); |
298 DCHECK(!AlreadyShowingInfoBar(render_process_id, render_view_id)); | 298 DCHECK(!AlreadyShowingInfoBar(render_process_id, render_view_id)); |
299 for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); | 299 for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); |
300 i != pending_infobar_requests_.end(); ++i) { | 300 i != pending_infobar_requests_.end(); ++i) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
357 void GeolocationInfoBarQueueController::UnregisterForInfoBarNotifications( | 357 void GeolocationInfoBarQueueController::UnregisterForInfoBarNotifications( |
358 InfoBarTabHelper* helper) { | 358 InfoBarTabHelper* helper) { |
359 if (registrar_.IsRegistered( | 359 if (registrar_.IsRegistered( |
360 this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 360 this, chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
361 content::Source<InfoBarTabHelper>(helper))) { | 361 content::Source<InfoBarTabHelper>(helper))) { |
362 registrar_.Remove(this, | 362 registrar_.Remove(this, |
363 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, | 363 chrome::NOTIFICATION_TAB_CONTENTS_INFOBAR_REMOVED, |
364 content::Source<InfoBarTabHelper>(helper)); | 364 content::Source<InfoBarTabHelper>(helper)); |
365 } | 365 } |
366 } | 366 } |
OLD | NEW |