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