OLD | NEW |
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/ui/webui/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 source == signin::SOURCE_AVATAR_BUBBLE_SIGN_IN) { | 59 source == signin::SOURCE_AVATAR_BUBBLE_SIGN_IN) { |
60 // Drop the leading slash in the path. | 60 // Drop the leading slash in the path. |
61 params.SetString("gaiaPath", | 61 params.SetString("gaiaPath", |
62 GaiaUrls::GetInstance()->embedded_signin_url().path().substr(1)); | 62 GaiaUrls::GetInstance()->embedded_signin_url().path().substr(1)); |
63 } | 63 } |
64 | 64 |
65 params.SetString("service", "chromiumsync"); | 65 params.SetString("service", "chromiumsync"); |
66 params.SetString("continueUrl", | 66 params.SetString("continueUrl", |
67 signin::GetLandingURL("source", static_cast<int>(source)).spec()); | 67 signin::GetLandingURL("source", static_cast<int>(source)).spec()); |
68 | 68 |
69 std::string last_email = Profile::FromWebUI(web_ui())->GetPrefs()->GetString( | 69 if (source != signin::SOURCE_AVATAR_BUBBLE_ADD_ACCOUNT) { |
70 prefs::kGoogleServicesLastUsername); | 70 std::string last_email = Profile::FromWebUI(web_ui())->GetPrefs()-> |
71 if (!last_email.empty()) | 71 GetString(prefs::kGoogleServicesLastUsername); |
72 params.SetString("email", last_email); | 72 if (!last_email.empty()) |
| 73 params.SetString("email", last_email); |
| 74 } |
73 | 75 |
74 std::string frame_url; | 76 std::string frame_url; |
75 net::GetValueForKeyInQuery(current_url, "frameUrl", &frame_url); | 77 net::GetValueForKeyInQuery(current_url, "frameUrl", &frame_url); |
76 if (!frame_url.empty()) | 78 if (!frame_url.empty()) |
77 params.SetString("frameUrl", frame_url); | 79 params.SetString("frameUrl", frame_url); |
78 | 80 |
79 std::string is_constrained; | 81 std::string is_constrained; |
80 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); | 82 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); |
81 if (!is_constrained.empty()) | 83 if (!is_constrained.empty()) |
82 params.SetString("constrained", is_constrained); | 84 params.SetString("constrained", is_constrained); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 TabStripModel* tab_strip_model = browser->tab_strip_model(); | 265 TabStripModel* tab_strip_model = browser->tab_strip_model(); |
264 if (tab_strip_model) { | 266 if (tab_strip_model) { |
265 int index = tab_strip_model->GetIndexOfWebContents(tab); | 267 int index = tab_strip_model->GetIndexOfWebContents(tab); |
266 if (index != TabStripModel::kNoTab) { | 268 if (index != TabStripModel::kNoTab) { |
267 tab_strip_model->ExecuteContextMenuCommand( | 269 tab_strip_model->ExecuteContextMenuCommand( |
268 index, TabStripModel::CommandCloseTab); | 270 index, TabStripModel::CommandCloseTab); |
269 } | 271 } |
270 } | 272 } |
271 } | 273 } |
272 } | 274 } |
OLD | NEW |