OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/webui/signin/inline_login_handler_impl.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 } // namespace | 230 } // namespace |
231 | 231 |
232 InlineLoginHandlerImpl::InlineLoginHandlerImpl() | 232 InlineLoginHandlerImpl::InlineLoginHandlerImpl() |
233 : confirm_untrusted_signin_(false), | 233 : confirm_untrusted_signin_(false), |
234 weak_factory_(this) { | 234 weak_factory_(this) { |
235 } | 235 } |
236 | 236 |
237 InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {} | 237 InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {} |
238 | 238 |
239 bool InlineLoginHandlerImpl::HandleContextMenu( | |
240 const content::ContextMenuParams& params) { | |
241 #ifndef NDEBUG | |
242 return false; | |
243 #else | |
244 return true; | |
245 #endif | |
246 } | |
247 | |
248 void InlineLoginHandlerImpl::DidCommitProvisionalLoadForFrame( | 239 void InlineLoginHandlerImpl::DidCommitProvisionalLoadForFrame( |
249 content::RenderFrameHost* render_frame_host, | 240 content::RenderFrameHost* render_frame_host, |
250 const GURL& url, | 241 const GURL& url, |
251 ui::PageTransition transition_type) { | 242 ui::PageTransition transition_type) { |
252 if (!web_contents()) | 243 if (!web_contents()) |
253 return; | 244 return; |
254 | 245 |
255 // Returns early if this is not a gaia iframe navigation. | 246 // Returns early if this is not a gaia iframe navigation. |
256 const GURL kGaiaExtOrigin( | 247 const GURL kGaiaExtOrigin( |
257 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); | 248 "chrome-extension://mfffpogegjflfpflabcdkioaeobkgjik/"); |
(...skipping 14 matching lines...) Expand all Loading... |
272 } | 263 } |
273 } | 264 } |
274 | 265 |
275 void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { | 266 void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) { |
276 params.SetString("service", "chromiumsync"); | 267 params.SetString("service", "chromiumsync"); |
277 | 268 |
278 content::WebContents* contents = web_ui()->GetWebContents(); | 269 content::WebContents* contents = web_ui()->GetWebContents(); |
279 const GURL& current_url = contents->GetURL(); | 270 const GURL& current_url = contents->GetURL(); |
280 std::string is_constrained; | 271 std::string is_constrained; |
281 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); | 272 net::GetValueForKeyInQuery(current_url, "constrained", &is_constrained); |
282 if (is_constrained == "1") | |
283 contents->SetDelegate(this); | |
284 | 273 |
285 content::WebContentsObserver::Observe(contents); | 274 content::WebContentsObserver::Observe(contents); |
286 | 275 |
287 signin::Source source = signin::GetSourceForPromoURL(current_url); | 276 signin::Source source = signin::GetSourceForPromoURL(current_url); |
288 OneClickSigninHelper::LogHistogramValue( | 277 OneClickSigninHelper::LogHistogramValue( |
289 source, one_click_signin::HISTOGRAM_SHOWN); | 278 source, one_click_signin::HISTOGRAM_SHOWN); |
290 } | 279 } |
291 | 280 |
292 void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) { | 281 void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) { |
293 content::WebContents* contents = web_ui()->GetWebContents(); | 282 content::WebContents* contents = web_ui()->GetWebContents(); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 } | 455 } |
467 } | 456 } |
468 | 457 |
469 if (show_account_management) { | 458 if (show_account_management) { |
470 browser->window()->ShowAvatarBubbleFromAvatarButton( | 459 browser->window()->ShowAvatarBubbleFromAvatarButton( |
471 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, | 460 BrowserWindow::AVATAR_BUBBLE_MODE_ACCOUNT_MANAGEMENT, |
472 signin::ManageAccountsParams()); | 461 signin::ManageAccountsParams()); |
473 } | 462 } |
474 } | 463 } |
475 } | 464 } |
OLD | NEW |