Commit 64121b7f authored by calamity's avatar calamity Committed by Commit bot

Fix experimental app list's start page logo not showing in Guest Mode.

This CL fixes an issue with the app list not showing the start page
logo in ChromeOS Guest Mode. This was happening because no start page
service was being created for incognito contexts.

This will also cause voice search to be enabled in the app list in
Guest Mode.

BUG=440484

Review URL: https://codereview.chromium.org/879033003

Cr-Commit-Position: refs/heads/master@{#315272}
parent 9506d1fb
...@@ -261,7 +261,7 @@ AppListServiceImpl::~AppListServiceImpl() {} ...@@ -261,7 +261,7 @@ AppListServiceImpl::~AppListServiceImpl() {}
AppListViewDelegate* AppListServiceImpl::GetViewDelegate(Profile* profile) { AppListViewDelegate* AppListServiceImpl::GetViewDelegate(Profile* profile) {
if (!view_delegate_) if (!view_delegate_)
view_delegate_.reset(new AppListViewDelegate(GetControllerDelegate())); view_delegate_.reset(new AppListViewDelegate(GetControllerDelegate()));
view_delegate_->SetProfile(profile); view_delegate_->SetProfile(profile->GetOriginalProfile());
return view_delegate_.get(); return view_delegate_.get();
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "chrome/browser/extensions/install_tracker_factory.h" #include "chrome/browser/extensions/install_tracker_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/start_page_service.h" #include "chrome/browser/ui/app_list/start_page_service.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -49,4 +50,10 @@ KeyedService* StartPageServiceFactory::BuildServiceInstanceFor( ...@@ -49,4 +50,10 @@ KeyedService* StartPageServiceFactory::BuildServiceInstanceFor(
return new StartPageService(profile); return new StartPageService(profile);
} }
content::BrowserContext* StartPageServiceFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
// The start page service needs an instance in ChromeOS guest mode.
return chrome::GetBrowserContextRedirectedInIncognito(context);
}
} // namespace app_list } // namespace app_list
...@@ -31,6 +31,8 @@ class StartPageServiceFactory : public BrowserContextKeyedServiceFactory { ...@@ -31,6 +31,8 @@ class StartPageServiceFactory : public BrowserContextKeyedServiceFactory {
// BrowserContextKeyedServiceFactory overrides: // BrowserContextKeyedServiceFactory overrides:
KeyedService* BuildServiceInstanceFor( KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override; content::BrowserContext* context) const override;
content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory); DISALLOW_COPY_AND_ASSIGN(StartPageServiceFactory);
}; };
......
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