fix: add theme data source for devtools.(32-x-y) (#44639)
fix: add theme data source for devtools.
This commit is contained in:
parent
45d4f25099
commit
39a24d96fc
9 changed files with 474 additions and 111 deletions
36
shell/browser/ui/devtools_ui_theme_data_source.h
Normal file
36
shell/browser/ui/devtools_ui_theme_data_source.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
// Copyright (c) 2024 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ELECTRON_SHELL_BROWSER_UI_DEVTOOLS_UI_THEME_DATA_SOURCE_H_
|
||||
#define ELECTRON_SHELL_BROWSER_UI_DEVTOOLS_UI_THEME_DATA_SOURCE_H_
|
||||
|
||||
#include "content/public/browser/url_data_source.h"
|
||||
|
||||
namespace electron {
|
||||
// A ThemeDataSource implementation that handles devtools://theme/
|
||||
// requests.
|
||||
class ThemeDataSource : public content::URLDataSource {
|
||||
public:
|
||||
ThemeDataSource() = default;
|
||||
~ThemeDataSource() override = default;
|
||||
|
||||
ThemeDataSource(const ThemeDataSource&) = delete;
|
||||
ThemeDataSource& operator=(const ThemeDataSource&) = delete;
|
||||
|
||||
std::string GetSource() override;
|
||||
|
||||
void StartDataRequest(const GURL& url,
|
||||
const content::WebContents::Getter& wc_getter,
|
||||
GotDataCallback callback) override;
|
||||
|
||||
private:
|
||||
std::string GetMimeType(const GURL& url) override;
|
||||
|
||||
void SendColorsCss(const GURL& url,
|
||||
const content::WebContents::Getter& wc_getter,
|
||||
content::URLDataSource::GotDataCallback callback);
|
||||
};
|
||||
|
||||
} // namespace electron
|
||||
#endif // ELECTRON_SHELL_BROWSER_UI_DEVTOOLS_UI_THEME_DATA_SOURCE_H_
|
Loading…
Add table
Add a link
Reference in a new issue