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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 10356059: Merge 135882 - [cros] Show release notes in app window + restore sesssion. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1084/src/
Patch Set: Created 8 years, 7 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/defaults.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 27 matching lines...) Expand all
38 #include "chrome/browser/prefs/pref_service.h" 38 #include "chrome/browser/prefs/pref_service.h"
39 #include "chrome/browser/prefs/session_startup_pref.h" 39 #include "chrome/browser/prefs/session_startup_pref.h"
40 #include "chrome/browser/profiles/profile_manager.h" 40 #include "chrome/browser/profiles/profile_manager.h"
41 #include "chrome/browser/ui/dialog_style.h" 41 #include "chrome/browser/ui/dialog_style.h"
42 #include "chrome/browser/ui/views/window.h" 42 #include "chrome/browser/ui/views/window.h"
43 #include "chrome/common/chrome_notification_types.h" 43 #include "chrome/common/chrome_notification_types.h"
44 #include "chrome/common/chrome_switches.h" 44 #include "chrome/common/chrome_switches.h"
45 #include "chrome/common/chrome_version_info.h" 45 #include "chrome/common/chrome_version_info.h"
46 #include "chrome/common/net/gaia/google_service_auth_error.h" 46 #include "chrome/common/net/gaia/google_service_auth_error.h"
47 #include "chrome/common/pref_names.h" 47 #include "chrome/common/pref_names.h"
48 #include "chrome/common/url_constants.h"
48 #include "content/public/browser/browser_thread.h" 49 #include "content/public/browser/browser_thread.h"
49 #include "content/public/browser/notification_service.h" 50 #include "content/public/browser/notification_service.h"
50 #include "content/public/browser/notification_types.h" 51 #include "content/public/browser/notification_types.h"
51 #include "grit/generated_resources.h" 52 #include "grit/generated_resources.h"
52 #include "net/http/http_auth_cache.h" 53 #include "net/http/http_auth_cache.h"
53 #include "net/http/http_network_session.h" 54 #include "net/http/http_network_session.h"
54 #include "net/http/http_transaction_factory.h" 55 #include "net/http/http_transaction_factory.h"
55 #include "net/url_request/url_request_context.h" 56 #include "net/url_request/url_request_context.h"
56 #include "net/url_request/url_request_context_getter.h" 57 #include "net/url_request/url_request_context_getter.h"
57 #include "ui/base/l10n/l10n_util.h" 58 #include "ui/base/l10n/l10n_util.h"
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 ServicesCustomizationDocument::GetInstance(); 732 ServicesCustomizationDocument::GetInstance();
732 if (!ServicesCustomizationDocument::WasApplied() && 733 if (!ServicesCustomizationDocument::WasApplied() &&
733 customization->IsReady()) { 734 customization->IsReady()) {
734 // Since we don't use OEM start URL anymore, just mark as applied. 735 // Since we don't use OEM start URL anymore, just mark as applied.
735 customization->ApplyCustomization(); 736 customization->ApplyCustomization();
736 } 737 }
737 738
738 if (!guide_url.empty()) { 739 if (!guide_url.empty()) {
739 CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kApp, 740 CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kApp,
740 guide_url); 741 guide_url);
742 // NTP would open in the background, app window with GSG would be focused
743 // so that user won't have an empty desktop after GSG is closed.
744 CommandLine::ForCurrentProcess()->AppendArg(chrome::kChromeUINewTabURL);
741 } else { 745 } else {
742 // We should not be adding any start URLs if guide 746 // We should not be adding any start URLs if guide
743 // is defined as it launches as a standalone app window. 747 // is defined as it launches as a standalone app window.
744 for (size_t i = 0; i < start_urls.size(); ++i) 748 for (size_t i = 0; i < start_urls.size(); ++i)
745 CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]); 749 CommandLine::ForCurrentProcess()->AppendArg(start_urls[i]);
746 } 750 }
747 } 751 }
748 752
749 void ExistingUserController::SetStatusAreaEnabled(bool enable) { 753 void ExistingUserController::SetStatusAreaEnabled(bool enable) {
750 if (!host_) 754 if (!host_)
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 if (!current_version.components().size()) { 820 if (!current_version.components().size()) {
817 NOTREACHED() << "Incorrect version " << current_version.GetString(); 821 NOTREACHED() << "Incorrect version " << current_version.GetString();
818 return; 822 return;
819 } 823 }
820 824
821 // TODO(nkostylev): Disable this prior to M19>M20 update. 825 // TODO(nkostylev): Disable this prior to M19>M20 update.
822 // Trigger on major version change. 826 // Trigger on major version change.
823 if (current_version.components()[0] > prev_version.components()[0]) { 827 if (current_version.components()[0] > prev_version.components()[0]) {
824 std::string release_notes_url = GetGettingStartedGuideURL(); 828 std::string release_notes_url = GetGettingStartedGuideURL();
825 if (!release_notes_url.empty()) { 829 if (!release_notes_url.empty()) {
826 // TODO(nkostylev): Ideally we'd want to show this in app window 830 CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kApp,
827 // but passing --app=<url> would ignore session restore. 831 release_notes_url);
828 CommandLine::ForCurrentProcess()->AppendArg(release_notes_url);
829 prefs->SetString(prefs::kChromeOSReleaseNotesVersion, 832 prefs->SetString(prefs::kChromeOSReleaseNotesVersion,
830 current_version.GetString()); 833 current_version.GetString());
831 } 834 }
832 } 835 }
833 } 836 }
834 837
835 void ExistingUserController::ShowError(int error_id, 838 void ExistingUserController::ShowError(int error_id,
836 const std::string& details) { 839 const std::string& details) {
837 // TODO(dpolukhin): show detailed error info. |details| string contains 840 // TODO(dpolukhin): show detailed error info. |details| string contains
838 // low level error info that is not localized and even is not user friendly. 841 // low level error info that is not localized and even is not user friendly.
(...skipping 29 matching lines...) Expand all
868 // changed. 871 // changed.
869 UserManager::Get()->SaveUserOAuthStatus(username, 872 UserManager::Get()->SaveUserOAuthStatus(username,
870 User::OAUTH_TOKEN_STATUS_INVALID); 873 User::OAUTH_TOKEN_STATUS_INVALID);
871 874
872 login_display_->SetUIEnabled(true); 875 login_display_->SetUIEnabled(true);
873 SetStatusAreaEnabled(true); 876 SetStatusAreaEnabled(true);
874 login_display_->ShowGaiaPasswordChanged(username); 877 login_display_->ShowGaiaPasswordChanged(username);
875 } 878 }
876 879
877 } // namespace chromeos 880 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/defaults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698