| 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 24 matching lines...) Expand all Loading... |
| 35 #include "grit/locale_settings.h" | 35 #include "grit/locale_settings.h" |
| 36 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
| 37 #include "grit/theme_resources_standard.h" | 37 #include "grit/theme_resources_standard.h" |
| 38 #include "net/base/net_util.h" | 38 #include "net/base/net_util.h" |
| 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
| 40 #include "ui/base/l10n/l10n_util.h" | 40 #include "ui/base/l10n/l10n_util.h" |
| 41 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
| 42 | 42 |
| 43 using WebKit::WebSecurityOrigin; | 43 using WebKit::WebSecurityOrigin; |
| 44 using content::BrowserThread; | 44 using content::BrowserThread; |
| 45 using content::NavigationEntry; |
| 45 using content::OpenURLParams; | 46 using content::OpenURLParams; |
| 46 using content::Referrer; | 47 using content::Referrer; |
| 47 using content::WebContents; | 48 using content::WebContents; |
| 48 | 49 |
| 49 // GeolocationInfoBarQueueController ------------------------------------------ | 50 // GeolocationInfoBarQueueController ------------------------------------------ |
| 50 | 51 |
| 51 // This class controls the geolocation infobar queue per profile, and it's an | 52 // This class controls the geolocation infobar queue per profile, and it's an |
| 52 // internal class to GeolocationPermissionContext. | 53 // internal class to GeolocationPermissionContext. |
| 53 // An alternate approach would be to have this queue per tab, and use | 54 // An alternate approach would be to have this queue per tab, and use |
| 54 // notifications to broadcast when permission is set / listen to notification to | 55 // notifications to broadcast when permission is set / listen to notification to |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 int bridge_id, | 172 int bridge_id, |
| 172 const GURL& requesting_frame_url, | 173 const GURL& requesting_frame_url, |
| 173 const std::string& display_languages) | 174 const std::string& display_languages) |
| 174 : ConfirmInfoBarDelegate(infobar_helper), | 175 : ConfirmInfoBarDelegate(infobar_helper), |
| 175 controller_(controller), | 176 controller_(controller), |
| 176 render_process_id_(render_process_id), | 177 render_process_id_(render_process_id), |
| 177 render_view_id_(render_view_id), | 178 render_view_id_(render_view_id), |
| 178 bridge_id_(bridge_id), | 179 bridge_id_(bridge_id), |
| 179 requesting_frame_url_(requesting_frame_url), | 180 requesting_frame_url_(requesting_frame_url), |
| 180 display_languages_(display_languages) { | 181 display_languages_(display_languages) { |
| 181 const content::NavigationEntry* committed_entry = | 182 const NavigationEntry* committed_entry = |
| 182 infobar_helper->web_contents()->GetController().GetLastCommittedEntry(); | 183 infobar_helper->web_contents()->GetController().GetLastCommittedEntry(); |
| 183 committed_contents_unique_id_ = committed_entry ? | 184 committed_contents_unique_id_ = committed_entry ? |
| 184 committed_entry->GetUniqueID() : 0; | 185 committed_entry->GetUniqueID() : 0; |
| 185 } | 186 } |
| 186 | 187 |
| 187 GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() { | 188 GeolocationConfirmInfoBarDelegate::~GeolocationConfirmInfoBarDelegate() { |
| 188 controller_->OnInfoBarClosed(render_process_id_, render_view_id_, | 189 controller_->OnInfoBarClosed(render_process_id_, render_view_id_, |
| 189 bridge_id_); | 190 bridge_id_); |
| 190 } | 191 } |
| 191 | 192 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 BrowserThread::UI, FROM_HERE, | 677 BrowserThread::UI, FROM_HERE, |
| 677 base::Bind( | 678 base::Bind( |
| 678 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, | 679 &ChromeGeolocationPermissionContext::CancelPendingInfoBarRequest, |
| 679 this, render_process_id, render_view_id, bridge_id)); | 680 this, render_process_id, render_view_id, bridge_id)); |
| 680 return; | 681 return; |
| 681 } | 682 } |
| 682 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 683 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 683 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, | 684 geolocation_infobar_queue_controller_->CancelInfoBarRequest(render_process_id, |
| 684 render_view_id, bridge_id); | 685 render_view_id, bridge_id); |
| 685 } | 686 } |
| OLD | NEW |