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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 content::PAGE_TRANSITION_START_PAGE, | 101 content::PAGE_TRANSITION_START_PAGE, |
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_ = new TabContents(contents_); | 111 tab_contents_ = TabContents::Factory::CreateTabContents(contents_); |
112 contents_ = NULL; | 112 contents_ = NULL; |
113 Browser* browser = new Browser(Browser::CreateParams( | 113 Browser* browser = new Browser(Browser::CreateParams( |
114 Browser::TYPE_POPUP, profile_)); | 114 Browser::TYPE_POPUP, profile_)); |
115 chrome::NavigateParams params(browser, tab_contents_); | 115 chrome::NavigateParams params(browser, tab_contents_); |
116 params.disposition = CURRENT_TAB; | 116 params.disposition = CURRENT_TAB; |
117 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 117 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
118 chrome::Navigate(¶ms); | 118 chrome::Navigate(¶ms); |
119 // Observe method will be called before URLs are loaded. That is where | 119 // Observe method will be called before URLs are loaded. That is where |
120 // we check for redirect to the right URL. | 120 // we check for redirect to the right URL. |
121 } | 121 } |
(...skipping 88 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 |