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