| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_permission_context.h" | 5 #include "chrome/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 22 matching lines...) Expand all Loading... |
| 33 GeolocationPermissionRequest(GeolocationPermissionContext* context, | 33 GeolocationPermissionRequest(GeolocationPermissionContext* context, |
| 34 const PermissionRequestID& id, | 34 const PermissionRequestID& id, |
| 35 const GURL& requesting_frame, | 35 const GURL& requesting_frame, |
| 36 const GURL& embedder, | 36 const GURL& embedder, |
| 37 bool user_gesture, | 37 bool user_gesture, |
| 38 base::Callback<void(bool)> callback, | 38 base::Callback<void(bool)> callback, |
| 39 const std::string& display_languages); | 39 const std::string& display_languages); |
| 40 virtual ~GeolocationPermissionRequest(); | 40 virtual ~GeolocationPermissionRequest(); |
| 41 | 41 |
| 42 // PermissionBubbleDelegate: | 42 // PermissionBubbleDelegate: |
| 43 virtual PermissionBubbleRequest::Type GetType() const OVERRIDE; |
| 43 virtual int GetIconID() const OVERRIDE; | 44 virtual int GetIconID() const OVERRIDE; |
| 44 virtual base::string16 GetMessageText() const OVERRIDE; | 45 virtual base::string16 GetMessageText() const OVERRIDE; |
| 45 virtual base::string16 GetMessageTextFragment() const OVERRIDE; | 46 virtual base::string16 GetMessageTextFragment() const OVERRIDE; |
| 46 virtual bool HasUserGesture() const OVERRIDE; | 47 virtual bool HasUserGesture() const OVERRIDE; |
| 47 virtual GURL GetRequestingHostname() const OVERRIDE; | 48 virtual GURL GetRequestingHostname() const OVERRIDE; |
| 48 virtual void PermissionGranted() OVERRIDE; | 49 virtual void PermissionGranted() OVERRIDE; |
| 49 virtual void PermissionDenied() OVERRIDE; | 50 virtual void PermissionDenied() OVERRIDE; |
| 50 virtual void Cancelled() OVERRIDE; | 51 virtual void Cancelled() OVERRIDE; |
| 51 virtual void RequestFinished() OVERRIDE; | 52 virtual void RequestFinished() OVERRIDE; |
| 52 | 53 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 71 : context_(context), | 72 : context_(context), |
| 72 id_(id), | 73 id_(id), |
| 73 requesting_frame_(requesting_frame), | 74 requesting_frame_(requesting_frame), |
| 74 embedder_(embedder), | 75 embedder_(embedder), |
| 75 user_gesture_(user_gesture), | 76 user_gesture_(user_gesture), |
| 76 callback_(callback), | 77 callback_(callback), |
| 77 display_languages_(display_languages) {} | 78 display_languages_(display_languages) {} |
| 78 | 79 |
| 79 GeolocationPermissionRequest::~GeolocationPermissionRequest() {} | 80 GeolocationPermissionRequest::~GeolocationPermissionRequest() {} |
| 80 | 81 |
| 82 PermissionBubbleRequest::Type GeolocationPermissionRequest::GetType() const { |
| 83 return PermissionBubbleRequest::Type::kGeolocation; |
| 84 } |
| 85 |
| 81 int GeolocationPermissionRequest::GetIconID() const { | 86 int GeolocationPermissionRequest::GetIconID() const { |
| 82 return IDR_INFOBAR_GEOLOCATION; | 87 return IDR_INFOBAR_GEOLOCATION; |
| 83 } | 88 } |
| 84 | 89 |
| 85 base::string16 GeolocationPermissionRequest::GetMessageText() const { | 90 base::string16 GeolocationPermissionRequest::GetMessageText() const { |
| 86 return l10n_util::GetStringFUTF16( | 91 return l10n_util::GetStringFUTF16( |
| 87 IDS_GEOLOCATION_INFOBAR_QUESTION, | 92 IDS_GEOLOCATION_INFOBAR_QUESTION, |
| 88 net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_, | 93 net::FormatUrl(requesting_frame_.GetOrigin(), display_languages_, |
| 89 net::kFormatUrlOmitUsernamePassword | | 94 net::kFormatUrlOmitUsernamePassword | |
| 90 net::kFormatUrlOmitTrailingSlashOnBareHostname, | 95 net::kFormatUrlOmitTrailingSlashOnBareHostname, |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 if (cancelling != NULL && web_contents != NULL && | 338 if (cancelling != NULL && web_contents != NULL && |
| 334 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { | 339 PermissionBubbleManager::FromWebContents(web_contents) != NULL) { |
| 335 PermissionBubbleManager::FromWebContents(web_contents)-> | 340 PermissionBubbleManager::FromWebContents(web_contents)-> |
| 336 CancelRequest(cancelling); | 341 CancelRequest(cancelling); |
| 337 } | 342 } |
| 338 return; | 343 return; |
| 339 } | 344 } |
| 340 | 345 |
| 341 QueueController()->CancelInfoBarRequest(id); | 346 QueueController()->CancelInfoBarRequest(id); |
| 342 } | 347 } |
| OLD | NEW |