58 lines
2.0 KiB
C++
58 lines
2.0 KiB
C++
/* Copyright 2019 The Brave Authors. All rights reserved.
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef BRAVE_BROWSER_UI_BRAVE_BROWSER_COMMAND_CONTROLLER_H_
|
|
#define BRAVE_BROWSER_UI_BRAVE_BROWSER_COMMAND_CONTROLLER_H_
|
|
|
|
#include "brave/components/tor/buildflags/buildflags.h"
|
|
#include "chrome/browser/ui/browser_command_controller.h"
|
|
|
|
// This namespace is needed for a chromium_src override
|
|
namespace chrome {
|
|
|
|
class BraveBrowserCommandController : public chrome::BrowserCommandController {
|
|
public:
|
|
explicit BraveBrowserCommandController(Browser* browser);
|
|
|
|
#if BUILDFLAG(ENABLE_TOR)
|
|
void UpdateCommandForTor();
|
|
#endif
|
|
|
|
private:
|
|
// Overriden from CommandUpdater:
|
|
bool SupportsCommand(int id) const override;
|
|
bool IsCommandEnabled(int id) const override;
|
|
bool ExecuteCommandWithDisposition(
|
|
int id,
|
|
WindowOpenDisposition disposition,
|
|
base::TimeTicks time_stamp = base::TimeTicks::Now()) override;
|
|
void AddCommandObserver(int id, CommandObserver* observer) override;
|
|
void RemoveCommandObserver(int id, CommandObserver* observer) override;
|
|
void RemoveCommandObserver(CommandObserver* observer) override;
|
|
bool UpdateCommandEnabled(int id, bool state) override;
|
|
|
|
void InitBraveCommandState();
|
|
void UpdateCommandForBraveRewards();
|
|
void UpdateCommandForBraveAdblock();
|
|
void UpdateCommandForWebcompatReporter();
|
|
void UpdateCommandForBraveSync();
|
|
void UpdateCommandForBraveWallet();
|
|
void UpdateCommandForSidebar();
|
|
|
|
bool ExecuteBraveCommandWithDisposition(int id,
|
|
WindowOpenDisposition disposition,
|
|
base::TimeTicks time_stamp);
|
|
|
|
Browser* const browser_;
|
|
|
|
CommandUpdaterImpl brave_command_updater_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(BraveBrowserCommandController);
|
|
};
|
|
|
|
} // namespace chrome
|
|
|
|
#endif // BRAVE_BROWSER_UI_BRAVE_BROWSER_COMMAND_CONTROLLER_H_
|