| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 controller->LoadURL( | 85 controller->LoadURL( |
| 86 provider_url_, | 86 provider_url_, |
| 87 content::Referrer(), | 87 content::Referrer(), |
| 88 content::PAGE_TRANSITION_AUTO_TOPLEVEL, | 88 content::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 89 std::string()); | 89 std::string()); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void WebAuthFlow::DetachDelegateAndDelete() { | 92 void WebAuthFlow::DetachDelegateAndDelete() { |
| 93 delegate_ = NULL; | 93 delegate_ = NULL; |
| 94 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 94 base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 95 } | 95 } |
| 96 | 96 |
| 97 WebContents* WebAuthFlow::CreateWebContents() { | 97 WebContents* WebAuthFlow::CreateWebContents() { |
| 98 return WebContents::Create(WebContents::CreateParams(profile_)); | 98 return WebContents::Create(WebContents::CreateParams(profile_)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void WebAuthFlow::ShowAuthFlowPopup() { | 101 void WebAuthFlow::ShowAuthFlowPopup() { |
| 102 Browser::CreateParams browser_params(Browser::TYPE_POPUP, profile_, | 102 Browser::CreateParams browser_params(Browser::TYPE_POPUP, profile_, |
| 103 host_desktop_type_); | 103 host_desktop_type_); |
| 104 browser_params.initial_bounds = initial_bounds_; | 104 browser_params.initial_bounds = initial_bounds_; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 AfterUrlLoaded(); | 171 AfterUrlLoaded(); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void WebAuthFlow::WebContentsDestroyed(WebContents* web_contents) { | 174 void WebAuthFlow::WebContentsDestroyed(WebContents* web_contents) { |
| 175 contents_ = NULL; | 175 contents_ = NULL; |
| 176 if (delegate_) | 176 if (delegate_) |
| 177 delegate_->OnAuthFlowFailure(WebAuthFlow::WINDOW_CLOSED); | 177 delegate_->OnAuthFlowFailure(WebAuthFlow::WINDOW_CLOSED); |
| 178 } | 178 } |
| 179 | 179 |
| 180 } // namespace extensions | 180 } // namespace extensions |
| OLD | NEW |