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_bubble_view.h" | 5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, | 97 cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, |
98 views::GridLayout::USE_PREF, 0, 0); | 98 views::GridLayout::USE_PREF, 0, 0); |
99 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing); | 99 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing); |
100 cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, | 100 cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0, |
101 views::GridLayout::USE_PREF, 0, 0); | 101 views::GridLayout::USE_PREF, 0, 0); |
102 | 102 |
103 // Add main text description. | 103 // Add main text description. |
104 views::Label* label = new views::Label( | 104 views::Label* label = new views::Label( |
105 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_BUBBLE_MESSAGE)); | 105 l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_BUBBLE_MESSAGE)); |
106 label->SetMultiLine(true); | 106 label->SetMultiLine(true); |
107 label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 107 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
108 label->SizeToFit(kMinimumLabelWidth); | 108 label->SizeToFit(kMinimumLabelWidth); |
109 | 109 |
110 layout->StartRow(0, kColumnSetFillAlign); | 110 layout->StartRow(0, kColumnSetFillAlign); |
111 layout->AddView(label); | 111 layout->AddView(label); |
112 | 112 |
113 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); | 113 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); |
114 | 114 |
115 // Add link for user to do advanced config of sync. | 115 // Add link for user to do advanced config of sync. |
116 advanced_link_= new views::Link( | 116 advanced_link_= new views::Link( |
117 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); | 117 l10n_util::GetStringUTF16(IDS_SYNC_PROMO_NTP_BUBBLE_ADVANCED)); |
118 advanced_link_->set_listener(this); | 118 advanced_link_->set_listener(this); |
119 advanced_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 119 advanced_link_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
120 | 120 |
121 // Add controls at the bottom. | 121 // Add controls at the bottom. |
122 ok_button_ = new views::NativeTextButton(this); | 122 ok_button_ = new views::NativeTextButton(this); |
123 ok_button_->SetIsDefault(true); | 123 ok_button_->SetIsDefault(true); |
124 | 124 |
125 undo_button_ = new views::NativeTextButton(this); | 125 undo_button_ = new views::NativeTextButton(this); |
126 | 126 |
127 // The default size of the buttons is too large. To allow them to be smaller | 127 // The default size of the buttons is too large. To allow them to be smaller |
128 // ignore the minimum default size. Furthermore, to make sure they are the | 128 // ignore the minimum default size. Furthermore, to make sure they are the |
129 // same size, SetText() is called with both strings on both buttons. | 129 // same size, SetText() is called with both strings on both buttons. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender, | 185 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender, |
186 const ui::Event& event) { | 186 const ui::Event& event) { |
187 StartFade(false); | 187 StartFade(false); |
188 if (ok_button_ == sender) { | 188 if (ok_button_ == sender) { |
189 base::ResetAndReturn(&start_sync_callback_).Run( | 189 base::ResetAndReturn(&start_sync_callback_).Run( |
190 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); | 190 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); |
191 } else { | 191 } else { |
192 start_sync_callback_.Reset(); | 192 start_sync_callback_.Reset(); |
193 } | 193 } |
194 } | 194 } |
OLD | NEW |