| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/signin_email_confirmation_dialog.h" | 5 #include "chrome/browser/ui/webui/signin/signin_email_confirmation_dialog.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 GURL SigninEmailConfirmationDialog::GetDialogContentURL() const { | 135 GURL SigninEmailConfirmationDialog::GetDialogContentURL() const { |
| 136 return GURL(chrome::kChromeUISigninEmailConfirmationURL); | 136 return GURL(chrome::kChromeUISigninEmailConfirmationURL); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void SigninEmailConfirmationDialog::GetWebUIMessageHandlers( | 139 void SigninEmailConfirmationDialog::GetWebUIMessageHandlers( |
| 140 std::vector<content::WebUIMessageHandler*>* handlers) const {} | 140 std::vector<content::WebUIMessageHandler*>* handlers) const {} |
| 141 | 141 |
| 142 void SigninEmailConfirmationDialog::GetDialogSize(gfx::Size* size) const { | 142 void SigninEmailConfirmationDialog::GetDialogSize(gfx::Size* size) const { |
| 143 // Avoid setting a dialog size in here as this dialog auto-resizes (see | 143 DCHECK(size); |
| 144 // method |SigninEmailConfirmationDialog::Show|. | 144 |
| 145 // Set the dialog width if it's not set, so that the dialog is center-aligned |
| 146 // horizontally when it appears. Avoid setting a dialog height in here as |
| 147 // this dialog auto-resizes. |
| 148 if (size->IsEmpty()) |
| 149 size->set_width(kDialogWidth); |
| 145 } | 150 } |
| 146 | 151 |
| 147 std::string SigninEmailConfirmationDialog::GetDialogArgs() const { | 152 std::string SigninEmailConfirmationDialog::GetDialogArgs() const { |
| 148 std::string data; | 153 std::string data; |
| 149 base::DictionaryValue dialog_args; | 154 base::DictionaryValue dialog_args; |
| 150 dialog_args.SetString("lastEmail", last_email_); | 155 dialog_args.SetString("lastEmail", last_email_); |
| 151 dialog_args.SetString("newEmail", new_email_); | 156 dialog_args.SetString("newEmail", new_email_); |
| 152 base::JSONWriter::Write(dialog_args, &data); | 157 base::JSONWriter::Write(dialog_args, &data); |
| 153 return data; | 158 return data; |
| 154 } | 159 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 192 |
| 188 void SigninEmailConfirmationDialog::OnCloseContents( | 193 void SigninEmailConfirmationDialog::OnCloseContents( |
| 189 content::WebContents* source, | 194 content::WebContents* source, |
| 190 bool* out_close_dialog) { | 195 bool* out_close_dialog) { |
| 191 *out_close_dialog = true; | 196 *out_close_dialog = true; |
| 192 } | 197 } |
| 193 | 198 |
| 194 bool SigninEmailConfirmationDialog::ShouldShowDialogTitle() const { | 199 bool SigninEmailConfirmationDialog::ShouldShowDialogTitle() const { |
| 195 return false; | 200 return false; |
| 196 } | 201 } |
| OLD | NEW |