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/chrome_quota_permission_context.h" | 5 #include "chrome/browser/chrome_quota_permission_context.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 const std::string& display_languages, | 54 const std::string& display_languages, |
55 const content::QuotaPermissionContext::PermissionCallback& callback); | 55 const content::QuotaPermissionContext::PermissionCallback& callback); |
56 | 56 |
57 ~QuotaPermissionRequest() override; | 57 ~QuotaPermissionRequest() override; |
58 | 58 |
59 // PermissionBubbleRequest: | 59 // PermissionBubbleRequest: |
60 int GetIconId() const override; | 60 int GetIconId() const override; |
61 base::string16 GetMessageText() const override; | 61 base::string16 GetMessageText() const override; |
62 base::string16 GetMessageTextFragment() const override; | 62 base::string16 GetMessageTextFragment() const override; |
63 bool HasUserGesture() const override; | 63 bool HasUserGesture() const override; |
64 GURL GetRequestingHostname() const override; | 64 GURL GetOrigin() const override; |
65 void PermissionGranted() override; | 65 void PermissionGranted() override; |
66 void PermissionDenied() override; | 66 void PermissionDenied() override; |
67 void Cancelled() override; | 67 void Cancelled() override; |
68 void RequestFinished() override; | 68 void RequestFinished() override; |
69 | 69 |
70 private: | 70 private: |
71 scoped_refptr<ChromeQuotaPermissionContext> context_; | 71 scoped_refptr<ChromeQuotaPermissionContext> context_; |
72 GURL origin_url_; | 72 GURL origin_url_; |
73 std::string display_languages_; | 73 std::string display_languages_; |
74 int64_t requested_quota_; | 74 int64_t requested_quota_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 } | 109 } |
110 | 110 |
111 base::string16 QuotaPermissionRequest::GetMessageTextFragment() const { | 111 base::string16 QuotaPermissionRequest::GetMessageTextFragment() const { |
112 return l10n_util::GetStringUTF16(IDS_REQUEST_QUOTA_PERMISSION_FRAGMENT); | 112 return l10n_util::GetStringUTF16(IDS_REQUEST_QUOTA_PERMISSION_FRAGMENT); |
113 } | 113 } |
114 | 114 |
115 bool QuotaPermissionRequest::HasUserGesture() const { | 115 bool QuotaPermissionRequest::HasUserGesture() const { |
116 return user_gesture_; | 116 return user_gesture_; |
117 } | 117 } |
118 | 118 |
119 GURL QuotaPermissionRequest::GetRequestingHostname() const { | 119 GURL QuotaPermissionRequest::GetOrigin() const { |
120 return origin_url_; | 120 return origin_url_; |
121 } | 121 } |
122 | 122 |
123 void QuotaPermissionRequest::PermissionGranted() { | 123 void QuotaPermissionRequest::PermissionGranted() { |
124 context_->DispatchCallbackOnIOThread( | 124 context_->DispatchCallbackOnIOThread( |
125 callback_, | 125 callback_, |
126 content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW); | 126 content::QuotaPermissionContext::QUOTA_PERMISSION_RESPONSE_ALLOW); |
127 callback_ = content::QuotaPermissionContext::PermissionCallback(); | 127 callback_ = content::QuotaPermissionContext::PermissionCallback(); |
128 } | 128 } |
129 | 129 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 content::BrowserThread::IO, FROM_HERE, | 330 content::BrowserThread::IO, FROM_HERE, |
331 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, | 331 base::Bind(&ChromeQuotaPermissionContext::DispatchCallbackOnIOThread, |
332 this, callback, response)); | 332 this, callback, response)); |
333 return; | 333 return; |
334 } | 334 } |
335 | 335 |
336 callback.Run(response); | 336 callback.Run(response); |
337 } | 337 } |
338 | 338 |
339 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() {} | 339 ChromeQuotaPermissionContext::~ChromeQuotaPermissionContext() {} |
OLD | NEW |