Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: chrome/browser/extensions/chrome_extensions_browser_client.cc

Issue 164333007: Switch guest profile from forced-incognito to UI mods like ChromeOS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed review comments by msw Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h" 5 #include "chrome/browser/extensions/chrome_extensions_browser_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/version.h" 8 #include "base/version.h"
9 #include "chrome/browser/app_mode/app_mode_utils.h" 9 #include "chrome/browser/app_mode/app_mode_utils.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 #else 113 #else
114 // There are no browser windows open and the browser process was 114 // There are no browser windows open and the browser process was
115 // started to show the app launcher. 115 // started to show the app launcher.
116 return chrome::GetTotalBrowserCountForProfile(profile) == 0 && 116 return chrome::GetTotalBrowserCountForProfile(profile) == 0 &&
117 CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList); 117 CommandLine::ForCurrentProcess()->HasSwitch(switches::kShowAppList);
118 #endif 118 #endif
119 } 119 }
120 120
121 bool ChromeExtensionsBrowserClient::IsBackgroundPageAllowed( 121 bool ChromeExtensionsBrowserClient::IsBackgroundPageAllowed(
122 content::BrowserContext* context) const { 122 content::BrowserContext* context) const {
123 #if defined(OS_CHROMEOS) 123 // Returns true if current session is Guest mode session and current
124 // Returns true if current session is Chrome OS Guest mode session and current
125 // browser context is *not* off-the-record. Such context is artificial and 124 // browser context is *not* off-the-record. Such context is artificial and
126 // background page shouldn't be created in it. 125 // background page shouldn't be created in it.
127 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 126 return !static_cast<Profile*>(context)->IsGuestSession() ||
128 if (command_line->HasSwitch(chromeos::switches::kGuestSession) && 127 context->IsOffTheRecord();
129 !context->IsOffTheRecord()) {
130 return false;
131 }
132 #endif
133 return true;
134 } 128 }
135 129
136 void ChromeExtensionsBrowserClient::OnExtensionHostCreated( 130 void ChromeExtensionsBrowserClient::OnExtensionHostCreated(
137 content::WebContents* web_contents) { 131 content::WebContents* web_contents) {
138 PrefsTabHelper::CreateForWebContents(web_contents); 132 PrefsTabHelper::CreateForWebContents(web_contents);
139 } 133 }
140 134
141 void ChromeExtensionsBrowserClient::OnRenderViewCreatedForBackgroundPage( 135 void ChromeExtensionsBrowserClient::OnRenderViewCreatedForBackgroundPage(
142 ExtensionHost* host) { 136 ExtensionHost* host) {
143 ExtensionService* service = 137 ExtensionService* service =
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 dependencies.push_back(ExtensionSystemSharedFactory::GetInstance()); 198 dependencies.push_back(ExtensionSystemSharedFactory::GetInstance());
205 return dependencies; 199 return dependencies;
206 } 200 }
207 201
208 ExtensionSystem* ChromeExtensionsBrowserClient::CreateExtensionSystem( 202 ExtensionSystem* ChromeExtensionsBrowserClient::CreateExtensionSystem(
209 content::BrowserContext* context) { 203 content::BrowserContext* context) {
210 return new ExtensionSystemImpl(static_cast<Profile*>(context)); 204 return new ExtensionSystemImpl(static_cast<Profile*>(context));
211 } 205 }
212 206
213 } // namespace extensions 207 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_system_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698