page_info_client_impl.cc 885 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "weblayer/browser/url_bar/page_info_client_impl.h"
  5. #include "content/public/browser/web_contents.h"
  6. #include "weblayer/browser/android/resource_mapper.h"
  7. #include "weblayer/browser/url_bar/page_info_delegate_impl.h"
  8. namespace weblayer {
  9. // static
  10. PageInfoClientImpl* PageInfoClientImpl::GetInstance() {
  11. return new PageInfoClientImpl();
  12. }
  13. std::unique_ptr<PageInfoDelegate> PageInfoClientImpl::CreatePageInfoDelegate(
  14. content::WebContents* web_contents) {
  15. DCHECK(web_contents);
  16. return std::make_unique<PageInfoDelegateImpl>(web_contents);
  17. }
  18. int PageInfoClientImpl::GetJavaResourceId(int native_resource_id) {
  19. return weblayer::MapToJavaDrawableId(native_resource_id);
  20. }
  21. } // namespace weblayer