-
Notifications
You must be signed in to change notification settings - Fork 822
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18922 from brave/linux_dark_theme
Prevent system theme change affect brave's theme in linux
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
chromium_src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc
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,33 @@ | ||
/* Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" | ||
|
||
#if defined(USE_DBUS) | ||
#include "chrome/browser/ui/views/dark_mode_manager_linux.h" | ||
#endif | ||
|
||
#if defined(USE_DBUS) | ||
namespace ui { | ||
|
||
class BraveDarkModeManagerLinux { | ||
public: | ||
BraveDarkModeManagerLinux() = default; | ||
~BraveDarkModeManagerLinux() = default; | ||
BraveDarkModeManagerLinux(const BraveDarkModeManagerLinux&) = delete; | ||
BraveDarkModeManagerLinux& operator=(const BraveDarkModeManagerLinux&) = | ||
delete; | ||
}; | ||
|
||
} // namespace ui | ||
|
||
#define DarkModeManagerLinux BraveDarkModeManagerLinux | ||
#endif | ||
|
||
#include "src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc" | ||
|
||
#if defined(USE_DBUS) | ||
#undef DarkModeManagerLinux | ||
#endif |
24 changes: 24 additions & 0 deletions
24
chromium_src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.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,24 @@ | ||
/* Copyright (c) 2023 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifndef BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LINUX_H_ | ||
#define BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LINUX_H_ | ||
|
||
#if defined(USE_DBUS) | ||
namespace ui { | ||
class BraveDarkModeManagerLinux; | ||
} // namespace ui | ||
|
||
// Remove this overriding when linux also supports system default theme option. | ||
#define DarkModeManagerLinux BraveDarkModeManagerLinux | ||
#endif | ||
|
||
#include "src/chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h" // IWYU pragma: export | ||
|
||
#if defined(USE_DBUS) | ||
#undef DarkModeManagerLinux | ||
#endif | ||
|
||
#endif // BRAVE_CHROMIUM_SRC_CHROME_BROWSER_UI_VIEWS_CHROME_BROWSER_MAIN_EXTRA_PARTS_VIEWS_LINUX_H_ |