OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/auto_login_prompter.h" | 5 #include "chrome/browser/ui/auto_login_prompter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) { | 122 void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) { |
123 // The args are URL encoded, so we need to decode them before use. | 123 // The args are URL encoded, so we need to decode them before use. |
124 url_canon::RawCanonOutputT<char16> output; | 124 url_canon::RawCanonOutputT<char16> output; |
125 url_util::DecodeURLEscapeSequences(args_.c_str(), args_.length(), &output); | 125 url_util::DecodeURLEscapeSequences(args_.c_str(), args_.length(), &output); |
126 std::string unescaped_args; | 126 std::string unescaped_args; |
127 UTF16ToUTF8(output.data(), output.length(), &unescaped_args); | 127 UTF16ToUTF8(output.data(), output.length(), &unescaped_args); |
128 // TODO(rogerta): what is the correct page transition? | 128 // TODO(rogerta): what is the correct page transition? |
129 navigation_controller_->LoadURL( | 129 navigation_controller_->LoadURL( |
130 GURL(GaiaUrls::GetInstance()->merge_session_url() + | 130 GURL(GaiaUrls::GetInstance()->merge_session_url() + |
131 "?source=chrome&uberauth=" + token + "&" + unescaped_args), | 131 "?source=chrome&uberauth=" + token + "&" + unescaped_args), |
132 GURL(), content::PAGE_TRANSITION_AUTO_BOOKMARK, std::string()); | 132 content::Referrer(), content::PAGE_TRANSITION_AUTO_BOOKMARK, |
| 133 std::string()); |
133 } | 134 } |
134 | 135 |
135 | 136 |
136 // AutoLoginInfoBarDelegate --------------------------------------------------- | 137 // AutoLoginInfoBarDelegate --------------------------------------------------- |
137 | 138 |
138 // This is the actual infobar displayed to prompt the user to auto-login. | 139 // This is the actual infobar displayed to prompt the user to auto-login. |
139 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate { | 140 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate { |
140 public: | 141 public: |
141 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, | 142 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, |
142 NavigationController* navigation_controller, | 143 NavigationController* navigation_controller, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 infobar_helper, &tab_contents_->controller(), | 336 infobar_helper, &tab_contents_->controller(), |
336 profile->GetTokenService(), profile->GetPrefs(), | 337 profile->GetTokenService(), profile->GetPrefs(), |
337 username_, args_)); | 338 username_, args_)); |
338 } | 339 } |
339 } | 340 } |
340 // Either we couldn't add the infobar, we added the infobar, or the tab | 341 // Either we couldn't add the infobar, we added the infobar, or the tab |
341 // contents was destroyed before the navigation completed. In any case | 342 // contents was destroyed before the navigation completed. In any case |
342 // there's no reason to live further. | 343 // there's no reason to live further. |
343 delete this; | 344 delete this; |
344 } | 345 } |
OLD | NEW |