chromium/chrome/browser/ui/views/accessibility/accessibility_focus_highlight.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// The number of pixels of padding between the outer edge of the focused
// element's bounding box and the inner edge of the inner focus ring.
constexpr int kPadding =;

// The size of the border radius of the innermost focus highlight ring.
constexpr int kBorderRadius =;

// The stroke width, in , of the innermost focus ring, and each line drawn
// as part of the focus ring gradient effect.
constexpr int kStrokeWidth =;

// The thickness, in px, of the outer focus ring gradient.
constexpr int kGradientWidth =;

// The padding between the bounds of the layer and the bounds of the
// drawn focus ring, in px. If it's zero the focus ring might be clipped.
constexpr int kLayerPadding =;

// Total px between the edge of the node and the edge of the layer.
constexpr int kTotalLayerPadding =;

// The amount of time it should take for the highlight to fade in.
constexpr auto kFadeInTime =;

// The amount of time the highlight should persist before beginning to fade.
constexpr auto kHighlightPersistTime =;

// The amount of time it should take for the highlight to fade out.
constexpr auto kFadeOutTime =;

}  // namespace

// static
base::TimeDelta AccessibilityFocusHighlight::fade_in_time_;

// static
base::TimeDelta AccessibilityFocusHighlight::persist_time_;

// static
base::TimeDelta AccessibilityFocusHighlight::fade_out_time_;

// static
bool AccessibilityFocusHighlight::skip_activation_check_for_testing_ =;

// static
bool AccessibilityFocusHighlight::use_default_color_for_testing_ =;

// static
bool AccessibilityFocusHighlight::no_fade_for_testing_ =;

AccessibilityFocusHighlight::AccessibilityFocusHighlight(
    BrowserView* browser_view)
    :{}

AccessibilityFocusHighlight::~AccessibilityFocusHighlight() {}

// static
void AccessibilityFocusHighlight::SetNoFadeForTesting() {}

// static
void AccessibilityFocusHighlight::SkipActivationCheckForTesting() {}

// static
void AccessibilityFocusHighlight::UseDefaultColorForTesting() {}

// static
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&) {}