summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjwd@chromium.org <jwd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 22:37:33 +0000
committerjwd@chromium.org <jwd@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-13 22:37:33 +0000
commit10507b335b0dd318390ac7a6c02c4922afb587e3 (patch)
tree1fd50356804329f0fc320a209bb7a79b6620c447 /chrome
parent4fe6405b11911a5d638c6cf6716e278e073e2457 (diff)
downloadchromium_src-10507b335b0dd318390ac7a6c02c4922afb587e3.zip
chromium_src-10507b335b0dd318390ac7a6c02c4922afb587e3.tar.gz
chromium_src-10507b335b0dd318390ac7a6c02c4922afb587e3.tar.bz2
Making IsGuestSession an instance method of Profile, instead of static.
BUG=103846 Review URL: https://chromiumcodereview.appspot.com/11363227 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/api/tabs/tabs.cc2
-rw-r--r--chrome/browser/pepper_broker_infobar_delegate.cc6
-rw-r--r--chrome/browser/profiles/off_the_record_profile_impl.cc2
-rw-r--r--chrome/browser/profiles/profile.cc1
-rw-r--r--chrome/browser/profiles/profile.h2
-rw-r--r--chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc3
-rw-r--r--chrome/browser/ui/browser_command_controller.cc6
-rw-r--r--chrome/browser/ui/browser_navigator.cc2
-rw-r--r--chrome/browser/ui/webui/options/options_ui.cc2
9 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc
index 52d2450..d6827db 100644
--- a/chrome/browser/extensions/api/tabs/tabs.cc
+++ b/chrome/browser/extensions/api/tabs/tabs.cc
@@ -369,7 +369,7 @@ bool CreateWindowFunction::ShouldOpenIncognitoWindow(
// Remove all URLs that are not allowed in an incognito session. Note that a
// ChromeOS guest session is not considered incognito in this case.
- if (incognito && !Profile::IsGuestSession()) {
+ if (incognito && !profile_->IsGuestSession()) {
std::string first_url_erased;
for (size_t i = 0; i < urls->size();) {
if (chrome::IsURLAllowedInIncognito((*urls)[i], profile())) {
diff --git a/chrome/browser/pepper_broker_infobar_delegate.cc b/chrome/browser/pepper_broker_infobar_delegate.cc
index 3ef8edf..6d322a3 100644
--- a/chrome/browser/pepper_broker_infobar_delegate.cc
+++ b/chrome/browser/pepper_broker_infobar_delegate.cc
@@ -37,14 +37,14 @@ void PepperBrokerInfoBarDelegate::Show(
const GURL& url,
const FilePath& plugin_path,
const base::Callback<void(bool)>& callback) {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents->GetBrowserContext());
// TODO(wad): Add ephemeral device ID support for broker in guest mode.
- if (Profile::IsGuestSession()) {
+ if (profile->IsGuestSession()) {
callback.Run(false);
return;
}
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
HostContentSettingsMap* content_settings =
profile->GetHostContentSettingsMap();
ContentSetting setting =
diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
index 6beec98..ca26602 100644
--- a/chrome/browser/profiles/off_the_record_profile_impl.cc
+++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
@@ -472,7 +472,7 @@ class GuestSessionProfile : public OffTheRecordProfileImpl {
Profile* Profile::CreateOffTheRecordProfile() {
OffTheRecordProfileImpl* profile = NULL;
#if defined(OS_CHROMEOS)
- if (Profile::IsGuestSession())
+ if (IsGuestSession())
profile = new GuestSessionProfile(this);
#endif
if (!profile)
diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
index 136c04d..282c0b1 100644
--- a/chrome/browser/profiles/profile.cc
+++ b/chrome/browser/profiles/profile.cc
@@ -119,7 +119,6 @@ std::string Profile::GetDebugName() {
return name;
}
-// static
bool Profile::IsGuestSession() {
#if defined(OS_CHROMEOS)
static bool is_guest_session =
diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h
index 47f1bb6..ded0879 100644
--- a/chrome/browser/profiles/profile.h
+++ b/chrome/browser/profiles/profile.h
@@ -316,7 +316,7 @@ class Profile : public content::BrowserContext {
std::string GetDebugName();
// Returns whether it is a guest session.
- static bool IsGuestSession();
+ bool IsGuestSession();
// Did the user restore the last session? This is set by SessionRestore.
void set_restored_last_session(bool restored_last_session) {
diff --git a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
index 118cac7..8e99060 100644
--- a/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/browser_launcher_item_controller.cc
@@ -36,7 +36,8 @@ BrowserLauncherItemController::BrowserLauncherItemController(
window_(window),
tab_model_(tab_model),
is_incognito_(tab_model->profile()->GetOriginalProfile() !=
- tab_model->profile() && !Profile::IsGuestSession()) {
+ tab_model->profile() &&
+ !tab_model->profile()->IsGuestSession()) {
DCHECK(window_);
window_->AddObserver(this);
}
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 930e037..e4ae218 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -851,14 +851,14 @@ void BrowserCommandController::InitCommandState() {
UpdateCommandsForDevTools();
command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, CanOpenTaskManager());
command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY,
- !Profile::IsGuestSession());
+ !profile()->IsGuestSession());
command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true);
command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_KEYBOARD, true);
command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE_VIA_MENU, true);
command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU,
- !Profile::IsGuestSession());
+ !profile()->IsGuestSession());
command_updater_.UpdateCommandEnabled(IDC_RECENT_TABS_MENU,
- !Profile::IsGuestSession() &&
+ !profile()->IsGuestSession() &&
!profile()->IsOffTheRecord());
command_updater_.UpdateCommandEnabled(
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc
index 70b76ec..7e1cb47 100644
--- a/chrome/browser/ui/browser_navigator.cc
+++ b/chrome/browser/ui/browser_navigator.cc
@@ -81,7 +81,7 @@ bool AdjustNavigateParamsForURL(chrome::NavigateParams* params) {
if (params->target_contents != NULL ||
chrome::IsURLAllowedInIncognito(params->url,
params->initiating_profile) ||
- Profile::IsGuestSession()) {
+ params->initiating_profile->IsGuestSession()) {
return true;
}
diff --git a/chrome/browser/ui/webui/options/options_ui.cc b/chrome/browser/ui/webui/options/options_ui.cc
index 05f3dcf..48744fe 100644
--- a/chrome/browser/ui/webui/options/options_ui.cc
+++ b/chrome/browser/ui/webui/options/options_ui.cc
@@ -358,7 +358,7 @@ base::RefCountedMemory* OptionsUI::GetFaviconResourceBytes(
void OptionsUI::InitializeHandlers() {
Profile* profile = Profile::FromWebUI(web_ui());
- DCHECK(!profile->IsOffTheRecord() || Profile::IsGuestSession());
+ DCHECK(!profile->IsOffTheRecord() || profile->IsGuestSession());
// A new web page DOM has been brought up in an existing renderer, causing
// this method to be called twice. If that happens, ignore the second call.