| // Copyright 2018 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| package org.chromium.chrome.browser.explore_sites; |
| |
| import android.app.Activity; |
| import android.view.View; |
| import android.view.ViewGroup; |
| |
| import org.chromium.chrome.R; |
| import org.chromium.chrome.browser.BasicNativePage; |
| import org.chromium.chrome.browser.ChromeActivity; |
| import org.chromium.chrome.browser.NativePageHost; |
| import org.chromium.chrome.browser.UrlConstants; |
| |
| /** |
| * Provides functionality when the user interacts with the explore sites page. |
| */ |
| public class ExploreSitesPage extends BasicNativePage { |
| private ViewGroup mView; |
| private String mTitle; |
| private Activity mActivity; |
| |
| /** |
| * Create a new instance of the explore sites page. |
| */ |
| public ExploreSitesPage(ChromeActivity activity, NativePageHost host) { |
| super(activity, host); |
| } |
| |
| @Override |
| protected void initialize(ChromeActivity activity, NativePageHost host) { |
| mActivity = activity; |
| mTitle = mActivity.getString(R.string.explore_sites_title); |
| mView = (ViewGroup) mActivity.getLayoutInflater().inflate( |
| R.layout.explore_sites_main, null); |
| } |
| |
| @Override |
| public String getHost() { |
| return UrlConstants.EXPLORE_HOST; |
| } |
| |
| @Override |
| public View getView() { |
| return mView; |
| } |
| |
| @Override |
| public String getTitle() { |
| return mTitle; |
| } |
| } |