| 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/mock_permission_request.h" | 5 #include "chrome/browser/permissions/mock_permission_request.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/grit/theme_resources.h" | 9 #include "chrome/grit/theme_resources.h" |
| 10 #include "ui/gfx/vector_icons_public.h" |
| 10 | 11 |
| 11 MockPermissionRequest::MockPermissionRequest() | 12 MockPermissionRequest::MockPermissionRequest() |
| 12 : MockPermissionRequest("test", | 13 : MockPermissionRequest("test", |
| 13 "button", | 14 "button", |
| 14 "button", | 15 "button", |
| 15 GURL("http://www.google.com"), | 16 GURL("http://www.google.com"), |
| 16 PermissionRequestType::UNKNOWN, | 17 PermissionRequestType::UNKNOWN, |
| 17 PermissionRequestGestureType::UNKNOWN) {} | 18 PermissionRequestGestureType::UNKNOWN) {} |
| 18 | 19 |
| 19 MockPermissionRequest::MockPermissionRequest( | 20 MockPermissionRequest::MockPermissionRequest( |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 const std::string& deny_label) | 53 const std::string& deny_label) |
| 53 : MockPermissionRequest(text, | 54 : MockPermissionRequest(text, |
| 54 accept_label, | 55 accept_label, |
| 55 deny_label, | 56 deny_label, |
| 56 GURL("http://www.google.com"), | 57 GURL("http://www.google.com"), |
| 57 PermissionRequestType::UNKNOWN, | 58 PermissionRequestType::UNKNOWN, |
| 58 PermissionRequestGestureType::UNKNOWN) {} | 59 PermissionRequestGestureType::UNKNOWN) {} |
| 59 | 60 |
| 60 MockPermissionRequest::~MockPermissionRequest() {} | 61 MockPermissionRequest::~MockPermissionRequest() {} |
| 61 | 62 |
| 62 int MockPermissionRequest::GetIconId() const { | 63 PermissionRequest::IconId MockPermissionRequest::GetIconId() const { |
| 63 // Use a valid icon ID to support UI tests. | 64 // Use a valid icon ID to support UI tests. |
| 64 return IDR_INFOBAR_MEDIA_STREAM_CAMERA; | 65 return gfx::VectorIconId::WARNING; |
| 65 } | 66 } |
| 66 | 67 |
| 67 base::string16 MockPermissionRequest::GetMessageTextFragment() const { | 68 base::string16 MockPermissionRequest::GetMessageTextFragment() const { |
| 68 return text_; | 69 return text_; |
| 69 } | 70 } |
| 70 | 71 |
| 71 GURL MockPermissionRequest::GetOrigin() const { | 72 GURL MockPermissionRequest::GetOrigin() const { |
| 72 return origin_; | 73 return origin_; |
| 73 } | 74 } |
| 74 | 75 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 : granted_(false), | 122 : granted_(false), |
| 122 cancelled_(false), | 123 cancelled_(false), |
| 123 finished_(false), | 124 finished_(false), |
| 124 request_type_(request_type), | 125 request_type_(request_type), |
| 125 gesture_type_(gesture_type) { | 126 gesture_type_(gesture_type) { |
| 126 text_ = base::UTF8ToUTF16(text); | 127 text_ = base::UTF8ToUTF16(text); |
| 127 accept_label_ = base::UTF8ToUTF16(accept_label); | 128 accept_label_ = base::UTF8ToUTF16(accept_label); |
| 128 deny_label_ = base::UTF8ToUTF16(deny_label); | 129 deny_label_ = base::UTF8ToUTF16(deny_label); |
| 129 origin_ = origin.GetOrigin(); | 130 origin_ = origin.GetOrigin(); |
| 130 } | 131 } |
| OLD | NEW |