Commit 27494ab9 authored by skau's avatar skau Committed by Commit bot

Let the incognito window print.

Provide the original profile to incognito so that users can still use
their printers.

BUG=678796

Review-Url: https://codereview.chromium.org/2610373003
Cr-Commit-Position: refs/heads/master@{#441812}
parent 33233d19
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/printing/printer_pref_manager_factory.h" #include "chrome/browser/chromeos/printing/printer_pref_manager_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
...@@ -30,6 +31,11 @@ PrinterPrefManagerFactory* PrinterPrefManagerFactory::GetInstance() { ...@@ -30,6 +31,11 @@ PrinterPrefManagerFactory* PrinterPrefManagerFactory::GetInstance() {
return g_printer_pref_manager.Pointer(); return g_printer_pref_manager.Pointer();
} }
content::BrowserContext* PrinterPrefManagerFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
PrinterPrefManagerFactory::PrinterPrefManagerFactory() PrinterPrefManagerFactory::PrinterPrefManagerFactory()
: BrowserContextKeyedServiceFactory( : BrowserContextKeyedServiceFactory(
"PrinterPrefManager", "PrinterPrefManager",
......
...@@ -23,6 +23,10 @@ class PrinterPrefManagerFactory : public BrowserContextKeyedServiceFactory { ...@@ -23,6 +23,10 @@ class PrinterPrefManagerFactory : public BrowserContextKeyedServiceFactory {
static PrinterPrefManagerFactory* GetInstance(); static PrinterPrefManagerFactory* GetInstance();
protected:
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
private: private:
friend struct base::DefaultLazyInstanceTraits<PrinterPrefManagerFactory>; friend struct base::DefaultLazyInstanceTraits<PrinterPrefManagerFactory>;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment