#include "chrome/browser/ui/views/accessibility/accessibility_focus_highlight.h"
#include <algorithm>
#include "build/build_config.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/focused_node_details.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_animation_observer.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/vector2d.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
namespace ui {
class Compositor;
}
namespace {
constexpr int kPadding = …;
constexpr int kBorderRadius = …;
constexpr int kStrokeWidth = …;
constexpr int kGradientWidth = …;
constexpr int kLayerPadding = …;
constexpr int kTotalLayerPadding = …;
constexpr auto kFadeInTime = …;
constexpr auto kHighlightPersistTime = …;
constexpr auto kFadeOutTime = …;
}
base::TimeDelta AccessibilityFocusHighlight::fade_in_time_;
base::TimeDelta AccessibilityFocusHighlight::persist_time_;
base::TimeDelta AccessibilityFocusHighlight::fade_out_time_;
bool AccessibilityFocusHighlight::skip_activation_check_for_testing_ = …;
bool AccessibilityFocusHighlight::use_default_color_for_testing_ = …;
bool AccessibilityFocusHighlight::no_fade_for_testing_ = …;
AccessibilityFocusHighlight::AccessibilityFocusHighlight(
BrowserView* browser_view)
: … { … }
AccessibilityFocusHighlight::~AccessibilityFocusHighlight() { … }
void AccessibilityFocusHighlight::SetNoFadeForTesting() { … }
void AccessibilityFocusHighlight::SkipActivationCheckForTesting() { … }
void AccessibilityFocusHighlight::UseDefaultColorForTesting() { … }
ui::Layer* AccessibilityFocusHighlight::GetLayerForTesting() { … }
SkColor AccessibilityFocusHighlight::GetHighlightColor() { … }
void AccessibilityFocusHighlight::CreateOrUpdateLayer(gfx::Rect node_bounds) { … }
void AccessibilityFocusHighlight::RemoveLayer() { … }
void AccessibilityFocusHighlight::AddOrRemoveObservers() { … }
void AccessibilityFocusHighlight::OnFocusChangedInPage(
const content::FocusedNodeDetails& details) { … }
void AccessibilityFocusHighlight::OnPaintLayer(
const ui::PaintContext& context) { … }
float AccessibilityFocusHighlight::ComputeOpacity(
base::TimeDelta time_since_layer_create,
base::TimeDelta time_since_focus_move) { … }
void AccessibilityFocusHighlight::OnAnimationStep(base::TimeTicks timestamp) { … }
void AccessibilityFocusHighlight::OnCompositingShuttingDown(
ui::Compositor* compositor) { … }
void AccessibilityFocusHighlight::OnTabStripModelChanged(
TabStripModel*,
const TabStripModelChange&,
const TabStripSelectionChange&) { … }