| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) { | 118 void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) { |
| 119 // The args are URL encoded, so we need to decode them before use. | 119 // The args are URL encoded, so we need to decode them before use. |
| 120 url_canon::RawCanonOutputT<char16> output; | 120 url_canon::RawCanonOutputT<char16> output; |
| 121 url_util::DecodeURLEscapeSequences(args_.c_str(), args_.length(), &output); | 121 url_util::DecodeURLEscapeSequences(args_.c_str(), args_.length(), &output); |
| 122 std::string unescaped_args; | 122 std::string unescaped_args; |
| 123 UTF16ToUTF8(output.data(), output.length(), &unescaped_args); | 123 UTF16ToUTF8(output.data(), output.length(), &unescaped_args); |
| 124 // TODO(rogerta): what is the correct page transition? | 124 // TODO(rogerta): what is the correct page transition? |
| 125 navigation_controller_->LoadURL( | 125 navigation_controller_->LoadURL( |
| 126 GURL(GaiaUrls::GetInstance()->merge_session_url() + | 126 GURL(GaiaUrls::GetInstance()->merge_session_url() + |
| 127 "?source=chrome&uberauth=" + token + "&" + unescaped_args), | 127 "?source=chrome&uberauth=" + token + "&" + unescaped_args), |
| 128 GURL(), PageTransition::AUTO_BOOKMARK, std::string()); | 128 GURL(), content::PAGE_TRANSITION_AUTO_BOOKMARK, std::string()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 // AutoLoginInfoBarDelegate --------------------------------------------------- | 132 // AutoLoginInfoBarDelegate --------------------------------------------------- |
| 133 | 133 |
| 134 // This is the actual infobar displayed to prompt the user to auto-login. | 134 // This is the actual infobar displayed to prompt the user to auto-login. |
| 135 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate { | 135 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate { |
| 136 public: | 136 public: |
| 137 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, | 137 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, |
| 138 NavigationController* navigation_controller, | 138 NavigationController* navigation_controller, |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 infobar_helper, &tab_contents_->controller(), | 329 infobar_helper, &tab_contents_->controller(), |
| 330 profile->GetTokenService(), profile->GetPrefs(), | 330 profile->GetTokenService(), profile->GetPrefs(), |
| 331 username_, args_)); | 331 username_, args_)); |
| 332 } | 332 } |
| 333 } | 333 } |
| 334 // Either we couldn't add the infobar, we added the infobar, or the tab | 334 // Either we couldn't add the infobar, we added the infobar, or the tab |
| 335 // contents was destroyed before the navigation completed. In any case | 335 // contents was destroyed before the navigation completed. In any case |
| 336 // there's no reason to live further. | 336 // there's no reason to live further. |
| 337 delete this; | 337 delete this; |
| 338 } | 338 } |
| OLD | NEW |