[Printing] Stop using GetUserAgent from non-browser process

https://chromium-review.googlesource.com/c/chromium/src/+/1353052
This commit is contained in:
deepak1556 2019-01-22 12:54:36 +05:30
parent 0e39ec688a
commit 52ef6d9ae4
3 changed files with 9 additions and 0 deletions

View file

@ -10,6 +10,7 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "atom/browser/atom_browser_client.h"
#include "atom/browser/atom_browser_context.h" #include "atom/browser/atom_browser_context.h"
#include "atom/browser/native_window.h" #include "atom/browser/native_window.h"
#include "atom/browser/ui/file_dialog.h" #include "atom/browser/ui/file_dialog.h"

View file

@ -58,6 +58,7 @@
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
#include "atom/renderer/printing/print_render_frame_helper_delegate.h" #include "atom/renderer/printing/print_render_frame_helper_delegate.h"
#include "components/printing/renderer/print_render_frame_helper.h" #include "components/printing/renderer/print_render_frame_helper.h"
#include "printing/print_settings.h"
#endif // BUILDFLAG(ENABLE_PRINTING) #endif // BUILDFLAG(ENABLE_PRINTING)
namespace atom { namespace atom {
@ -288,6 +289,12 @@ bool RendererClientBase::IsKeySystemsUpdateNeeded() {
#endif #endif
} }
void RendererClientBase::DidSetUserAgent(const std::string& user_agent) {
#if BUILDFLAG(ENABLE_PRINTING)
printing::SetAgent(user_agent);
#endif
}
v8::Local<v8::Context> RendererClientBase::GetContext( v8::Local<v8::Context> RendererClientBase::GetContext(
blink::WebLocalFrame* frame, blink::WebLocalFrame* frame,
v8::Isolate* isolate) const { v8::Isolate* isolate) const {

View file

@ -61,6 +61,7 @@ class RendererClientBase : public content::ContentRendererClient {
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems)
override; override;
bool IsKeySystemsUpdateNeeded() override; bool IsKeySystemsUpdateNeeded() override;
void DidSetUserAgent(const std::string& user_agent) override;
private: private:
std::unique_ptr<PreferencesManager> preferences_manager_; std::unique_ptr<PreferencesManager> preferences_manager_;