| OLD | NEW |
| 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/geolocation/chrome_geolocation_permission_context.h" | 5 #include "chrome/browser/geolocation/chrome_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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 386 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 387 | 387 |
| 388 ContentSetting content_setting = | 388 ContentSetting content_setting = |
| 389 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; | 389 allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; |
| 390 profile_->GetHostContentSettingsMap()->SetContentSetting( | 390 profile_->GetHostContentSettingsMap()->SetContentSetting( |
| 391 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), | 391 ContentSettingsPattern::FromURLNoWildcard(requesting_frame.GetOrigin()), |
| 392 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), | 392 ContentSettingsPattern::FromURLNoWildcard(embedder.GetOrigin()), |
| 393 CONTENT_SETTINGS_TYPE_GEOLOCATION, | 393 CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 394 std::string(), | 394 std::string(), |
| 395 content_setting); | 395 content_setting); |
| 396 profile_->GetPrefs()->ScheduleSavePersistentPrefs(); | |
| 397 | 396 |
| 398 for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); | 397 for (PendingInfoBarRequests::iterator i = pending_infobar_requests_.begin(); |
| 399 i != pending_infobar_requests_.end(); ) { | 398 i != pending_infobar_requests_.end(); ) { |
| 400 if (i->IsForPair(requesting_frame, embedder)) { | 399 if (i->IsForPair(requesting_frame, embedder)) { |
| 401 // Cancel this request first, then notify listeners. TODO(pkasting): Why | 400 // Cancel this request first, then notify listeners. TODO(pkasting): Why |
| 402 // is this order important? | 401 // is this order important? |
| 403 // NOTE: If the pending request had an infobar, TabContents will close it | 402 // NOTE: If the pending request had an infobar, TabContents will close it |
| 404 // either synchronously or asynchronously, which will then pump the queue | 403 // either synchronously or asynchronously, which will then pump the queue |
| 405 // via OnInfoBarClosed(). | 404 // via OnInfoBarClosed(). |
| 406 PendingInfoBarRequest copied_request = *i; | 405 PendingInfoBarRequest copied_request = *i; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 BrowserThread::UI, FROM_HERE, | 635 BrowserThread::UI, FROM_HERE, |
| 637 base::Bind( | 636 base::Bind( |
| 638 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 637 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
| 639 this, render_process_id, render_view_id, bridge_id)); | 638 this, render_process_id, render_view_id, bridge_id)); |
| 640 return; | 639 return; |
| 641 } | 640 } |
| 642 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 641 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 643 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, | 642 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, |
| 644 render_view_id, bridge_id); | 643 render_view_id, bridge_id); |
| 645 } | 644 } |
| OLD | NEW |