| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/permissions/permission_bubble_request_impl.h" | 5 #include "chrome/browser/permissions/permission_bubble_request_impl.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/browser/permissions/permission_context_base.h" | 8 #include "chrome/browser/permissions/permission_context_base.h" |
| 9 #include "chrome/browser/permissions/permission_uma_util.h" | 9 #include "chrome/browser/permissions/permission_uma_util.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 NOTREACHED(); | 143 NOTREACHED(); |
| 144 return base::string16(); | 144 return base::string16(); |
| 145 } | 145 } |
| 146 return l10n_util::GetStringUTF16(message_id); | 146 return l10n_util::GetStringUTF16(message_id); |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool PermissionBubbleRequestImpl::HasUserGesture() const { | 149 bool PermissionBubbleRequestImpl::HasUserGesture() const { |
| 150 return user_gesture_; | 150 return user_gesture_; |
| 151 } | 151 } |
| 152 | 152 |
| 153 GURL PermissionBubbleRequestImpl::GetRequestingHostname() const { | 153 GURL PermissionBubbleRequestImpl::GetOrigin() const { |
| 154 return request_origin_; | 154 return request_origin_; |
| 155 } | 155 } |
| 156 | 156 |
| 157 void PermissionBubbleRequestImpl::PermissionGranted() { | 157 void PermissionBubbleRequestImpl::PermissionGranted() { |
| 158 RegisterActionTaken(); | 158 RegisterActionTaken(); |
| 159 permission_decided_callback_.Run(true, CONTENT_SETTING_ALLOW); | 159 permission_decided_callback_.Run(true, CONTENT_SETTING_ALLOW); |
| 160 } | 160 } |
| 161 | 161 |
| 162 void PermissionBubbleRequestImpl::PermissionDenied() { | 162 void PermissionBubbleRequestImpl::PermissionDenied() { |
| 163 RegisterActionTaken(); | 163 RegisterActionTaken(); |
| 164 permission_decided_callback_.Run(true, CONTENT_SETTING_BLOCK); | 164 permission_decided_callback_.Run(true, CONTENT_SETTING_BLOCK); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void PermissionBubbleRequestImpl::Cancelled() { | 167 void PermissionBubbleRequestImpl::Cancelled() { |
| 168 RegisterActionTaken(); | 168 RegisterActionTaken(); |
| 169 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); | 169 permission_decided_callback_.Run(false, CONTENT_SETTING_DEFAULT); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void PermissionBubbleRequestImpl::RequestFinished() { | 172 void PermissionBubbleRequestImpl::RequestFinished() { |
| 173 is_finished_ = true; | 173 is_finished_ = true; |
| 174 delete_callback_.Run(); | 174 delete_callback_.Run(); |
| 175 } | 175 } |
| OLD | NEW |