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/chrome_to_mobile_bubble_view.h" | 5 #include "chrome/browser/ui/views/chrome_to_mobile_bubble_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string16.h" | 9 #include "base/string16.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 IDS_CHROME_TO_MOBILE_BUBBLE_MULTI_TITLE)); | 244 IDS_CHROME_TO_MOBILE_BUBBLE_MULTI_TITLE)); |
245 | 245 |
246 string16 name; | 246 string16 name; |
247 const DictionaryValue* mobile = NULL; | 247 const DictionaryValue* mobile = NULL; |
248 views::RadioButton* radio = NULL; | 248 views::RadioButton* radio = NULL; |
249 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); | 249 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); |
250 for (size_t index = 0; index < mobiles->GetSize(); ++index) { | 250 for (size_t index = 0; index < mobiles->GetSize(); ++index) { |
251 if (mobiles->GetDictionary(index, &mobile) && | 251 if (mobiles->GetDictionary(index, &mobile) && |
252 mobile->GetString("name", &name)) { | 252 mobile->GetString("name", &name)) { |
253 radio = new views::RadioButton(name, 0); | 253 radio = new views::RadioButton(name, 0); |
254 radio->SetEnabledColor(SK_ColorBLACK); | 254 radio->SetTextColor(views::Button::STATE_NORMAL, SK_ColorBLACK); |
255 radio->SetHoverColor(SK_ColorBLACK); | 255 radio->SetTextColor(views::Button::STATE_HOVERED, SK_ColorBLACK); |
256 radio_buttons_.push_back(radio); | 256 radio_buttons_.push_back(radio); |
257 layout->StartRow(0, kRadioColumnSetId); | 257 layout->StartRow(0, kRadioColumnSetId); |
258 layout->AddView(radio); | 258 layout->AddView(radio); |
259 } else { | 259 } else { |
260 NOTREACHED(); | 260 NOTREACHED(); |
261 } | 261 } |
262 } | 262 } |
263 radio_buttons_[0]->SetChecked(true); | 263 radio_buttons_[0]->SetChecked(true); |
264 } | 264 } |
265 | 265 |
266 send_copy_ = new views::Checkbox( | 266 send_copy_ = new views::Checkbox( |
267 l10n_util::GetStringFUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, | 267 l10n_util::GetStringFUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, |
268 l10n_util::GetStringUTF16( | 268 l10n_util::GetStringUTF16( |
269 IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY_GENERATING))); | 269 IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY_GENERATING))); |
270 send_copy_->SetEnabledColor(SK_ColorBLACK); | 270 send_copy_->SetTextColor(views::Button::STATE_NORMAL, SK_ColorBLACK); |
271 send_copy_->SetHoverColor(SK_ColorBLACK); | 271 send_copy_->SetTextColor(views::Button::STATE_HOVERED, SK_ColorBLACK); |
272 send_copy_->SetEnabled(false); | 272 send_copy_->SetEnabled(false); |
273 layout->StartRow(0, kSingleColumnSetId); | 273 layout->StartRow(0, kSingleColumnSetId); |
274 layout->AddView(send_copy_); | 274 layout->AddView(send_copy_); |
275 | 275 |
276 views::Link* learn_more = | 276 views::Link* learn_more = |
277 new views::Link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 277 new views::Link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
278 learn_more->set_listener(this); | 278 learn_more->set_listener(this); |
279 | 279 |
280 send_ = new views::LabelButton( | 280 send_ = new views::LabelButton( |
281 this, l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SEND)); | 281 this, l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SEND)); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 } | 346 } |
347 | 347 |
348 // Update the view's contents to show the "Sending..." progress animation. | 348 // Update the view's contents to show the "Sending..." progress animation. |
349 cancel_->SetEnabled(false); | 349 cancel_->SetEnabled(false); |
350 send_->SetEnabled(false); | 350 send_->SetEnabled(false); |
351 send_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 351 send_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
352 progress_animation_.reset(new ui::ThrobAnimation(this)); | 352 progress_animation_.reset(new ui::ThrobAnimation(this)); |
353 progress_animation_->SetDuration(kProgressThrobDurationMS); | 353 progress_animation_->SetDuration(kProgressThrobDurationMS); |
354 progress_animation_->StartThrobbing(-1); | 354 progress_animation_->StartThrobbing(-1); |
355 } | 355 } |
OLD | NEW |