Commit Graph
8 Commits
Author SHA1 Message Date
Mario Sanchez Prada bbf5fd3fe9 Remove deprecated DISALLOW_ macros from Brave-specific code
Macros such as DISALLOW_COPY_AND_ASSIGN() are deprecated since r711900
per style arbitration [1]. This commit replaces the macros with deleted
constructors and methods, which is preferred by the Google C++ Style
Guide [2][3].

Also remove unneeded "base/macros.h" #includes when possible.

This CL is created semi-mechanically with remove_disallow and
remove_base_macros [4].

[1]: https://groups.google.com/a/chromium.org/g/cxx/c/qwH2hxaEjac/m/TUKq6eqfCwAJ
[2]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++-dos-and-donts.md#explicitly-declare-class-copyability_movability
[3]: https://google.github.io/styleguide/cppguide.html#Copyable_Movable_Types
[4]: https://pkg.go.dev/go.timothygu.me/tools/cr/cmd

Chromium change:

https://chromium.googlesource.com/chromium/src.git/+/d002a3bee7ae75780b604d17df19291a3dd303fb

commit d002a3bee7ae75780b604d17df19291a3dd303fb
Author: Peter Boström <pbos@chromium.org>
Date:   Fri Nov 5 17:17:19 2021 +0000

    Remove DISALLOW_ macros from base/macros.h

    This removes DISALLOW_COPY(), DISALLOW_ASSIGN() and
    DISALLOW_COPY_AND_ASSIGN() from base/macros.h. PRESUBMITs are also
    updated to no longer check for these macros.

    IWYU removal is left as a separate change just in case this needs to be
    reverted.

    Bug: 1010217
2022-01-24 15:33:37 -05:00
Mario Sanchez Prada 10c9ed746e Move away from using base::{Bind,Callback,Closure}()
base::{Bind,Callback,Closure}() have been deprecatedfor a while now,
are finally gone on Chromium 92, so it would be good to migrate all
current instances in the code (and stop introducing new ones) to the
Once/Repeating variants instead to easy further rebases.

This patch changes ALL instances of those old definitions and move
to using the Once variants whenever possible (as they are preferred)
and Repeating variants in every other case.

Last, this patch also makes some changes in brave_rewards_api.{h,cc}
to use weak pointers instead of base::Unretained() when binding
callbacks, for extra safety (and consistency with existing code).

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2867526

Resolves https://github.com/brave/brave-browser/issues/15855
2021-05-20 16:27:04 +02:00
mkarolin 781b95bb3a Lint fixes. 2021-02-04 23:52:43 -05:00
mkarolin ba721f1c35 DevToolsUIBindings DispatchCallback -> OnceCallback.
Chromium change:

https://source.chromium.org/chromium/chromium/src/+/bd25816fff5e8c0f27a2f84667fa0b2eb42f02c4

commit bd25816fff5e8c0f27a2f84667fa0b2eb42f02c4
Author: Leonard Grey <lgrey@chromium.org>
Date:   Fri Jan 8 19:10:32 2021 +0000

    [Code health] Convert DispatchCallback to OnceCallback

    Bug: 1152274
2021-02-04 23:52:26 -05:00
mkarolin 35e73f73f7 [Browser Tests] IWYU browser_test.h.
Chromium change:

https://chromium.googlesource.com/chromium/src/+/919ce657e4e37dfa13758f1eb8fe0e9ef7ab1b20

commit 919ce657e4e37dfa13758f1eb8fe0e9ef7ab1b20
Author: Peter Kasting <pkasting@chromium.org>
Date:   Thu May 7 10:22:36 2020 +0000

    Add missing #includes of browser_test.h.

    This is a step towards doing full IWYU of browser_test.h, which will
    have other benefits.

    Completely mechanical and already R+ed as part of r765923.

    Bug: none
2020-07-01 18:12:03 -04:00
Simon Hong 24cf9d8f0c Migrate brave theme prefs from profile to local state
With this, we can fix brave theme related bugs with multi profile
because all profiles use browser-wide prefs.
So far, system theme could be changed whenever new profile is used
because brave theme was profile prefs but system theme is browser
wide setting. And did cleanup and refactoring.

Refactoring point is separation of theme managing and dark mode managing.
So far, theme service has all dark mode handling logic.
But I think theme service handles browser theme with underrlying dark mode.
So, all dark mode logic is in dark_mode namespace.

fix https://github.com/brave/brave-browser/issues/5373
fix https://github.com/brave/brave-browser/issues/5557
2019-12-19 07:47:27 +09:00
Simon Hong 7a2b64d873 Fix brave_devtools_ui_bindings.obj link error on Windows Release
When devtools_ui_bindings target is built, BraveDevToolsUIBindings
added more dependencies that are not included in chrome_child.dll.
To fix this, //brave/browser/devtools target is separated from
//chrome/browser/devtools and it is added in the deps list of
//brave/browser/ui targets because it is only used from it.
2018-11-24 00:07:36 +09:00
Simon Hong f0bd657140 Consider brave theme type to devtools' theme
When devtool ui is loaded, kDevToolsPreferences pref values are fetched.
In that dictionary prefs, uiTheme represents theme type(light/dark) of devtool.
To apply brave theme type to devtools, uiTheme value is replaced with brave
native theme type. If user sets devtools' theme type explicitely, that value
is used instead of brave theme type. Otherwise, brave theme type is applied.
2018-11-12 23:42:41 +09:00