blob: e475fd79218843b0950115d86bba8011a4851dc8 [file]
// 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.
#ifndef CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_EPHEMERAL_TAB_LAYER_H_
#define CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_EPHEMERAL_TAB_LAYER_H_
#include "chrome/browser/android/compositor/layer/overlay_panel_layer.h"
class Profile;
namespace base {
class CancelableTaskTracker;
}
namespace cc {
class Layer;
}
namespace ui {
class ResourceManager;
}
namespace android {
class EphemeralTabLayer : public OverlayPanelLayer {
public:
static scoped_refptr<EphemeralTabLayer> Create(
ui::ResourceManager* resource_manager);
void SetProperties(int title_view_resource_id,
jfloat text_layer_min_height,
int progress_bar_background_resource_id,
int progress_bar_resource_id,
float dp_to_px,
const scoped_refptr<cc::Layer>& content_layer,
float panel_x,
float panel_y,
float panel_width,
float panel_height,
int bar_background_color,
float bar_margin_side,
float bar_margin_top,
float bar_height,
bool bar_border_visible,
float bar_border_height,
bool bar_shadow_visible,
float bar_shadow_opacity,
int icon_color,
int drag_handlebar_color,
bool progress_bar_visible,
float progress_bar_height,
float progress_bar_opacity,
int progress_bar_completion);
void SetupTextLayer(float bar_top,
float bar_height,
float text_layer_min_height,
int context_resource_id);
void GetLocalFaviconImageForURL(Profile* profile,
const std::string& url,
int size);
protected:
explicit EphemeralTabLayer(ui::ResourceManager* resource_manager);
~EphemeralTabLayer() override;
private:
float dp_to_px_;
float panel_width_;
float bar_height_;
float bar_margin_side_;
scoped_refptr<cc::UIResourceLayer> title_;
scoped_refptr<cc::UIResourceLayer> favicon_layer_;
scoped_refptr<cc::UIResourceLayer> text_layer_;
std::unique_ptr<base::CancelableTaskTracker> cancelable_task_tracker_;
};
} // namespace android
#endif // CHROME_BROWSER_ANDROID_COMPOSITOR_LAYER_EPHEMERAL_TAB_LAYER_H_