fix https://github.com/brave/brave-browser/issues/24055 User can add to dock via first run or settings.
26 lines
877 B
Plaintext
26 lines
877 B
Plaintext
/* Copyright (c) 2022 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/. */
|
|
|
|
#include "brave/browser/brave_shell_integration_mac.h"
|
|
|
|
#include "base/mac/bundle_locations.h"
|
|
#include "chrome/browser/mac/dock.h"
|
|
|
|
namespace shell_integration::mac {
|
|
|
|
void AddIconToDock(base::OnceCallback<void(bool)> result_callback) {
|
|
dock::AddIcon([base::mac::MainBundle() bundlePath], nullptr);
|
|
|
|
std::move(result_callback)
|
|
.Run(dock::ChromeIsInTheDock() == dock::ChromeInDockTrue);
|
|
}
|
|
|
|
void IsIconAddedToDock(base::OnceCallback<void(bool)> result_callback) {
|
|
std::move(result_callback)
|
|
.Run(dock::ChromeIsInTheDock() == dock::ChromeInDockTrue);
|
|
}
|
|
|
|
} // namespace shell_integration::mac
|