chromium/chrome/browser/accessibility/ax_main_node_annotator_controller.h

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

#ifndef CHROME_BROWSER_ACCESSIBILITY_AX_MAIN_NODE_ANNOTATOR_CONTROLLER_H_
#define CHROME_BROWSER_ACCESSIBILITY_AX_MAIN_NODE_ANNOTATOR_CONTROLLER_H_

#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/scoped_observation.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/screen_ai/screen_ai_install_state.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/prefs/pref_change_registrar.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "base/callback_list.h"
#else
#include "ui/accessibility/ax_mode_observer.h"
#include "ui/accessibility/platform/ax_platform.h"
#endif

class Profile;

#if BUILDFLAG(IS_CHROMEOS_ASH)
namespace ash {
struct AccessibilityStatusEventDetails;
}
#endif

namespace content {
class ScopedAccessibilityMode;
}  // namespace content

namespace screen_ai {

class AXMainNodeAnnotatorControllerFactory;

// Manages the feature that identifies the main landmark in a web page. Observes
// changes in the per-profile preference and updates the accessibility mode of
// WebContents when it changes, provided its feature flag is enabled.
class AXMainNodeAnnotatorController : public KeyedService,
                                      public ScreenAIInstallState::Observer
#if !BUILDFLAG(IS_CHROMEOS_ASH)
    ,
                                      public ui::AXModeObserver
#endif
{};

}  // namespace screen_ai

#endif  // CHROME_BROWSER_ACCESSIBILITY_AX_MAIN_NODE_ANNOTATOR_CONTROLLER_H_