| 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/ui/views/sync/one_click_signin_dialog_view.h" | 5 #include "chrome/browser/ui/views/sync/one_click_signin_dialog_view.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 OneClickSigninDialogView::~OneClickSigninDialogView() { | 80 OneClickSigninDialogView::~OneClickSigninDialogView() { |
| 81 if (!start_sync_callback_.is_null()) { | 81 if (!start_sync_callback_.is_null()) { |
| 82 base::ResetAndReturn(&start_sync_callback_) | 82 base::ResetAndReturn(&start_sync_callback_) |
| 83 .Run(OneClickSigninSyncStarter::UNDO_SYNC); | 83 .Run(OneClickSigninSyncStarter::UNDO_SYNC); |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 | 86 |
| 87 void OneClickSigninDialogView::Init() { | 87 void OneClickSigninDialogView::Init() { |
| 88 views::GridLayout* layout = views::GridLayout::CreatePanel(this); | 88 views::GridLayout* layout = views::GridLayout::CreatePanel(this); |
| 89 SetLayoutManager(layout); | |
| 90 | 89 |
| 91 // Column set for descriptive text and link. | 90 // Column set for descriptive text and link. |
| 92 views::ColumnSet* cs = layout->AddColumnSet(0); | 91 views::ColumnSet* cs = layout->AddColumnSet(0); |
| 93 cs->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 1, | 92 cs->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 1, |
| 94 views::GridLayout::USE_PREF, 0, 0); | 93 views::GridLayout::USE_PREF, 0, 0); |
| 95 | 94 |
| 96 layout->StartRow(0, 0); | 95 layout->StartRow(0, 0); |
| 97 | 96 |
| 98 views::Label* label = new views::Label(l10n_util::GetStringFUTF16( | 97 views::Label* label = new views::Label(l10n_util::GetStringFUTF16( |
| 99 IDS_ONE_CLICK_SIGNIN_DIALOG_MESSAGE_NEW, email_)); | 98 IDS_ONE_CLICK_SIGNIN_DIALOG_MESSAGE_NEW, email_)); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 .Run(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); | 151 .Run(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST); |
| 153 GetWidget()->Close(); | 152 GetWidget()->Close(); |
| 154 } | 153 } |
| 155 } | 154 } |
| 156 | 155 |
| 157 bool OneClickSigninDialogView::Accept() { | 156 bool OneClickSigninDialogView::Accept() { |
| 158 base::ResetAndReturn(&start_sync_callback_) | 157 base::ResetAndReturn(&start_sync_callback_) |
| 159 .Run(OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 158 .Run(OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
| 160 return true; | 159 return true; |
| 161 } | 160 } |
| OLD | NEW |