OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/profile_signin_confirmation_dialog.h" | 5 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 const int kProfileCreationMessageHeight = prompt_for_new_profile_ ? 50 : 0; | 262 const int kProfileCreationMessageHeight = prompt_for_new_profile_ ? 50 : 0; |
263 size->SetSize(kMinimumDialogWidth, | 263 size->SetSize(kMinimumDialogWidth, |
264 kMinimumDialogHeight + kProfileCreationMessageHeight); | 264 kMinimumDialogHeight + kProfileCreationMessageHeight); |
265 } | 265 } |
266 | 266 |
267 std::string ProfileSigninConfirmationDialog::GetDialogArgs() const { | 267 std::string ProfileSigninConfirmationDialog::GetDialogArgs() const { |
268 std::string data; | 268 std::string data; |
269 DictionaryValue dict; | 269 DictionaryValue dict; |
270 dict.SetString("username", username_); | 270 dict.SetString("username", username_); |
271 dict.SetBoolean("promptForNewProfile", prompt_for_new_profile_); | 271 dict.SetBoolean("promptForNewProfile", prompt_for_new_profile_); |
272 #ifdef OS_WIN | 272 #if defined(OS_WIN) |
273 dict.SetBoolean("hideTitle", true); | 273 dict.SetBoolean("hideTitle", true); |
274 #endif | 274 #endif |
275 base::JSONWriter::Write(&dict, &data); | 275 base::JSONWriter::Write(&dict, &data); |
276 return data; | 276 return data; |
277 } | 277 } |
278 | 278 |
279 void ProfileSigninConfirmationDialog::OnDialogClosed( | 279 void ProfileSigninConfirmationDialog::OnDialogClosed( |
280 const std::string& json_retval) { | 280 const std::string& json_retval) { |
281 if (!closed_by_handler_) | 281 if (!closed_by_handler_) |
282 cancel_signin_.Run(); | 282 cancel_signin_.Run(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 kHistoryEntriesBeforeNewProfilePrompt), | 376 kHistoryEntriesBeforeNewProfilePrompt), |
377 base::Bind(&ProfileSigninConfirmationDialog::CheckHasTypedURLs, | 377 base::Bind(&ProfileSigninConfirmationDialog::CheckHasTypedURLs, |
378 weak_pointer_factory_.GetWeakPtr()), | 378 weak_pointer_factory_.GetWeakPtr()), |
379 return_result); | 379 return_result); |
380 } | 380 } |
381 | 381 |
382 void ProfileSigninConfirmationDialog::OnPromptCheckComplete(bool prompt) { | 382 void ProfileSigninConfirmationDialog::OnPromptCheckComplete(bool prompt) { |
383 prompt_for_new_profile_ = prompt; | 383 prompt_for_new_profile_ = prompt; |
384 Show(); | 384 Show(); |
385 } | 385 } |
OLD | NEW |