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/identity_api.h" | 5 #include "chrome/browser/extensions/api/identity/identity_api.h" |
6 | 6 |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/common/extensions/api/experimental_identity.h" | 8 #include "chrome/common/extensions/api/experimental_identity.h" |
9 #include "chrome/browser/extensions/extension_install_prompt.h" | 9 #include "chrome/browser/extensions/extension_install_prompt.h" |
10 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 10 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 void IdentityGetAuthTokenFunction::ShowLoginPopup() { | 171 void IdentityGetAuthTokenFunction::ShowLoginPopup() { |
172 StartObservingLoginService(); | 172 StartObservingLoginService(); |
173 | 173 |
174 LoginUIService* login_ui_service = | 174 LoginUIService* login_ui_service = |
175 LoginUIServiceFactory::GetForProfile(profile()); | 175 LoginUIServiceFactory::GetForProfile(profile()); |
176 LoginUIService::LoginUI* login_ui = login_ui_service->current_login_ui(); | 176 LoginUIService::LoginUI* login_ui = login_ui_service->current_login_ui(); |
177 if (login_ui) { | 177 if (login_ui) { |
178 login_ui->FocusUI(); | 178 login_ui->FocusUI(); |
179 } else { | 179 } else { |
180 Browser* browser = Browser::CreateWithParams(Browser::CreateParams( | 180 Browser* browser = |
181 Browser::TYPE_POPUP, profile())); | 181 new Browser(Browser::CreateParams(Browser::TYPE_POPUP, profile())); |
182 // TODO(munjal): Change the source from SOURCE_NTP_LINK to something else | 182 // TODO(munjal): Change the source from SOURCE_NTP_LINK to something else |
183 // once we have added a new source for extension API. | 183 // once we have added a new source for extension API. |
184 GURL signin_url(SyncPromoUI::GetSyncPromoURL(GURL(), | 184 GURL signin_url(SyncPromoUI::GetSyncPromoURL(GURL(), |
185 SyncPromoUI::SOURCE_NTP_LINK, | 185 SyncPromoUI::SOURCE_NTP_LINK, |
186 true)); | 186 true)); |
187 chrome::NavigateParams params(browser, | 187 chrome::NavigateParams params(browser, |
188 signin_url, | 188 signin_url, |
189 content::PAGE_TRANSITION_START_PAGE); | 189 content::PAGE_TRANSITION_START_PAGE); |
190 params.disposition = CURRENT_TAB; | 190 params.disposition = CURRENT_TAB; |
191 params.window_action = chrome::NavigateParams::SHOW_WINDOW; | 191 params.window_action = chrome::NavigateParams::SHOW_WINDOW; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 Release(); // Balanced in RunImpl. | 252 Release(); // Balanced in RunImpl. |
253 } | 253 } |
254 | 254 |
255 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure() { | 255 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowFailure() { |
256 error_ = identity_constants::kInvalidRedirect; | 256 error_ = identity_constants::kInvalidRedirect; |
257 SendResponse(false); | 257 SendResponse(false); |
258 Release(); // Balanced in RunImpl. | 258 Release(); // Balanced in RunImpl. |
259 } | 259 } |
260 | 260 |
261 } // namespace extensions | 261 } // namespace extensions |
OLD | NEW |