| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/web_restrictions/browser/web_restrictions_mojo_implementati
on.h" | 5 #include "components/web_restrictions/browser/web_restrictions_mojo_implementati
on.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 WebRestrictionsMojoImplementation::WebRestrictionsMojoImplementation( | 26 WebRestrictionsMojoImplementation::WebRestrictionsMojoImplementation( |
| 27 WebRestrictionsClient* client) | 27 WebRestrictionsClient* client) |
| 28 : web_restrictions_client_(client) {} | 28 : web_restrictions_client_(client) {} |
| 29 | 29 |
| 30 WebRestrictionsMojoImplementation::~WebRestrictionsMojoImplementation() {} | 30 WebRestrictionsMojoImplementation::~WebRestrictionsMojoImplementation() {} |
| 31 | 31 |
| 32 void WebRestrictionsMojoImplementation::Create( | 32 void WebRestrictionsMojoImplementation::Create( |
| 33 WebRestrictionsClient* client, | 33 WebRestrictionsClient* client, |
| 34 mojo::InterfaceRequest<mojom::WebRestrictions> request) { | 34 const service_manager::BindSourceInfo& source_info, |
| 35 mojom::WebRestrictionsRequest request) { |
| 35 mojo::MakeStrongBinding( | 36 mojo::MakeStrongBinding( |
| 36 base::MakeUnique<WebRestrictionsMojoImplementation>(client), | 37 base::MakeUnique<WebRestrictionsMojoImplementation>(client), |
| 37 std::move(request)); | 38 std::move(request)); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void WebRestrictionsMojoImplementation::GetResult( | 41 void WebRestrictionsMojoImplementation::GetResult( |
| 41 const std::string& url, | 42 const std::string& url, |
| 42 const GetResultCallback& callback) { | 43 const GetResultCallback& callback) { |
| 43 std::unique_ptr<const WebRestrictionsClientResult> web_restrictions_result( | 44 std::unique_ptr<const WebRestrictionsClientResult> web_restrictions_result( |
| 44 web_restrictions_client_->GetCachedWebRestrictionsResult(url)); | 45 web_restrictions_client_->GetCachedWebRestrictionsResult(url)); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 } | 62 } |
| 62 | 63 |
| 63 void WebRestrictionsMojoImplementation::RequestPermission( | 64 void WebRestrictionsMojoImplementation::RequestPermission( |
| 64 const std::string& url, | 65 const std::string& url, |
| 65 const mojom::WebRestrictions::RequestPermissionCallback& callback) { | 66 const mojom::WebRestrictions::RequestPermissionCallback& callback) { |
| 66 web_restrictions_client_->RequestPermission( | 67 web_restrictions_client_->RequestPermission( |
| 67 url, base::Bind(&ClientRequestPermissionCallback, callback)); | 68 url, base::Bind(&ClientRequestPermissionCallback, callback)); |
| 68 } | 69 } |
| 69 | 70 |
| 70 } // namespace web_restrictions | 71 } // namespace web_restrictions |
| OLD | NEW |