-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix brave/brave-browser#24055 User can add to dock via first run or settings.
- Loading branch information
Showing
12 changed files
with
149 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* 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/. */ | ||
|
||
#ifndef BRAVE_BROWSER_BRAVE_SHELL_INTEGRATION_MAC_H_ | ||
#define BRAVE_BROWSER_BRAVE_SHELL_INTEGRATION_MAC_H_ | ||
|
||
#include "base/callback.h" | ||
#include "base/callback_helpers.h" | ||
|
||
namespace shell_integration::mac { | ||
|
||
// No-op if already added. | ||
void AddIconToDock( | ||
base::OnceCallback<void(bool)> result_callback = base::DoNothing()); | ||
void IsIconAddedToDock(base::OnceCallback<void(bool)> result_callback); | ||
} // namespace shell_integration::mac | ||
|
||
#endif // BRAVE_BROWSER_BRAVE_SHELL_INTEGRATION_MAC_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters