| OLD | NEW |
| 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/extensions/api/identity/web_auth_flow.h" | 5 #include "chrome/browser/extensions/api/identity/web_auth_flow.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/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, | 91 content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT, |
| 92 content::Source<WebContents>(contents_)); | 92 content::Source<WebContents>(contents_)); |
| 93 registrar_.Add( | 93 registrar_.Add( |
| 94 this, | 94 this, |
| 95 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 95 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 96 content::Source<WebContents>(contents_)); | 96 content::Source<WebContents>(contents_)); |
| 97 | 97 |
| 98 controller->LoadURL( | 98 controller->LoadURL( |
| 99 provider_url_, | 99 provider_url_, |
| 100 content::Referrer(), | 100 content::Referrer(), |
| 101 content::PAGE_TRANSITION_START_PAGE, | 101 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 102 std::string()); | 102 std::string()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 WebContents* WebAuthFlow::CreateWebContents() { | 105 WebContents* WebAuthFlow::CreateWebContents() { |
| 106 return WebContents::Create(profile_, NULL, MSG_ROUTING_NONE, NULL); | 106 return WebContents::Create(profile_, NULL, MSG_ROUTING_NONE, NULL); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void WebAuthFlow::ShowAuthFlowPopup() { | 109 void WebAuthFlow::ShowAuthFlowPopup() { |
| 110 // Pass ownership of WebContents to TabContents. | 110 // Pass ownership of WebContents to TabContents. |
| 111 tab_contents_ = TabContents::Factory::CreateTabContents(contents_); | 111 tab_contents_ = TabContents::Factory::CreateTabContents(contents_); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 void WebAuthFlow::InitValidRedirectUrlPrefixes( | 211 void WebAuthFlow::InitValidRedirectUrlPrefixes( |
| 212 const std::string& extension_id) { | 212 const std::string& extension_id) { |
| 213 valid_prefixes_.push_back(base::StringPrintf( | 213 valid_prefixes_.push_back(base::StringPrintf( |
| 214 kChromeExtensionSchemeUrlPattern, extension_id.c_str())); | 214 kChromeExtensionSchemeUrlPattern, extension_id.c_str())); |
| 215 valid_prefixes_.push_back(base::StringPrintf( | 215 valid_prefixes_.push_back(base::StringPrintf( |
| 216 kChromiumDomainRedirectUrlPattern, extension_id.c_str())); | 216 kChromiumDomainRedirectUrlPattern, extension_id.c_str())); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace extensions | 219 } // namespace extensions |
| OLD | NEW |