#ifndef CHROME_BROWSER_UI_STARTUP_FOCUS_FOCUS_HANDLER_H_
#define CHROME_BROWSER_UI_STARTUP_FOCUS_FOCUS_HANDLER_H_
#include <optional>
#include <string>
#include <vector>
#include "base/time/time.h"
#include "chrome/browser/ui/startup/focus/match_candidate.h"
#include "chrome/browser/ui/startup/focus/selector.h"
class Profile;
namespace base {
class CommandLine;
}
namespace focus {
enum class FocusStatus {
kFocused,
kNoMatch,
kParseError,
kOpenedFallback,
};
struct FocusResult {
enum class Error {
kNone,
kEmptySelector,
kInvalidFormat,
};
explicit FocusResult(FocusStatus status);
FocusResult(FocusStatus status,
const std::string& matched_selector,
const std::string& matched_url);
FocusResult(FocusStatus status, Error error_type);
FocusResult(FocusStatus status, std::string opened_url);
FocusResult(const FocusResult& other);
FocusResult(FocusResult&& other) noexcept;
FocusResult& operator=(const FocusResult& other);
FocusResult& operator=(FocusResult&& other) noexcept;
~FocusResult();
bool IsSuccess() const;
bool HasMatch() const;
FocusStatus status;
std::optional<std::string> matched_selector;
std::optional<std::string> matched_url;
std::optional<std::string> opened_url;
Error error_type;
};
FocusResult ProcessFocusRequest(const base::CommandLine& command_line,
Profile& profile);
FocusResult ProcessFocusRequestWithResultFile(
const base::CommandLine& command_line,
Profile& profile);
}
#endif