From 625f95b184032003bc96fa84035b97ab34b29485 Mon Sep 17 00:00:00 2001
From: "altimofeev@chromium.org"
 <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Tue, 23 Nov 2010 18:50:21 +0000
Subject: [PATCH] Changes appearance of the NTP for the guest mode.

1. Returns icon of the incognito guy to the tab header.
2. Sets NTP as homepage for the guest mode.
3. Adds the missing separator between the options.

BUG=chromium-os:9534
TEST=manual

Review URL: http://codereview.chromium.org/5314002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67125 0039d316-1c4b-4281-b951-d872f2087c98
---
 chrome/browser/chromeos/login/login_utils.cc  | 9 ++++++++-
 chrome/browser/ui/views/frame/browser_view.cc | 8 +-------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index 80b7d206d0eec..ab8c2f19513bc 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -45,6 +45,7 @@
 #include "chrome/common/net/gaia/gaia_constants.h"
 #include "chrome/common/net/url_request_context_getter.h"
 #include "chrome/common/pref_names.h"
+#include "chrome/common/url_constants.h"
 #include "googleurl/src/gurl.h"
 #include "net/base/cookie_store.h"
 #include "net/url_request/url_request_context.h"
@@ -62,7 +63,7 @@ const char kAuthSuffix[] = "\n";
 const char kGuestModeLoggingLevel[] = "1";
 
 // Format of command line switch.
-const char kSwitchFormatString[] = "--%s=\"%s\"";
+const char kSwitchFormatString[] = " --%s=\"%s\"";
 
 }  // namespace
 
@@ -313,6 +314,12 @@ void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) {
     if (start_url.is_valid())
       command_line.AppendArg(start_url.spec());
 
+    // Override the value of the homepage that is set in first run mode.
+    // TODO(altimofeev): extend action of the |kNoFirstRun| to cover this case.
+    command_line.AppendSwitchASCII(
+        switches::kHomePage,
+        GURL(chrome::kChromeUINewTabURL).spec());
+
     std::string cmd_line_str = command_line.command_line_string();
     // Special workaround for the arguments that should be quoted.
     // Copying switches won't be needed when Guest mode won't need restart
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 1c5c5ee28583b..eb2a263559e3d 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -595,13 +595,7 @@ bool BrowserView::IsOffTheRecord() const {
 }
 
 bool BrowserView::ShouldShowOffTheRecordAvatar() const {
-  bool should_show_off_the_record_avatar =
-      IsOffTheRecord() && IsBrowserTypeNormal();
-#if defined(OS_CHROMEOS)
-  should_show_off_the_record_avatar = should_show_off_the_record_avatar &&
-      !CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession);
-#endif
-  return should_show_off_the_record_avatar;
+  return IsOffTheRecord() && IsBrowserTypeNormal();
 }
 
 bool BrowserView::AcceleratorPressed(const views::Accelerator& accelerator) {
-- 
GitLab