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/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string16.h" | 10 #include "base/string16.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 message = IDS_CHROME_TO_MOBILE_BUBBLE_SENDING_2; | 173 message = IDS_CHROME_TO_MOBILE_BUBBLE_SENDING_2; |
174 send_->SetText(l10n_util::GetStringUTF16(message)); | 174 send_->SetText(l10n_util::GetStringUTF16(message)); |
175 // Run Layout but do not resize the bubble for each progress message. | 175 // Run Layout but do not resize the bubble for each progress message. |
176 Layout(); | 176 Layout(); |
177 return; | 177 return; |
178 } | 178 } |
179 views::BubbleDelegateView::AnimationProgressed(animation); | 179 views::BubbleDelegateView::AnimationProgressed(animation); |
180 } | 180 } |
181 | 181 |
182 void ChromeToMobileBubbleView::ButtonPressed(views::Button* sender, | 182 void ChromeToMobileBubbleView::ButtonPressed(views::Button* sender, |
183 const views::Event& event) { | 183 const ui::Event& event) { |
184 HandleButtonPressed(sender); | 184 HandleButtonPressed(sender); |
185 } | 185 } |
186 | 186 |
187 void ChromeToMobileBubbleView::SnapshotGenerated(const FilePath& path, | 187 void ChromeToMobileBubbleView::SnapshotGenerated(const FilePath& path, |
188 int64 bytes) { | 188 int64 bytes) { |
189 snapshot_path_ = path; | 189 snapshot_path_ = path; |
190 if (bytes > 0) { | 190 if (bytes > 0) { |
191 service_->LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED); | 191 service_->LogMetric(ChromeToMobileService::SNAPSHOT_GENERATED); |
192 send_copy_->SetText(l10n_util::GetStringFUTF16( | 192 send_copy_->SetText(l10n_util::GetStringFUTF16( |
193 IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, ui::FormatBytes(bytes))); | 193 IDS_CHROME_TO_MOBILE_BUBBLE_SEND_COPY, ui::FormatBytes(bytes))); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 } | 376 } |
377 | 377 |
378 // Update the view's contents to show the "Sending..." progress animation. | 378 // Update the view's contents to show the "Sending..." progress animation. |
379 cancel_->SetEnabled(false); | 379 cancel_->SetEnabled(false); |
380 send_->SetEnabled(false); | 380 send_->SetEnabled(false); |
381 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); | 381 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); |
382 progress_animation_.reset(new ui::ThrobAnimation(this)); | 382 progress_animation_.reset(new ui::ThrobAnimation(this)); |
383 progress_animation_->SetDuration(kProgressThrobDurationMS); | 383 progress_animation_->SetDuration(kProgressThrobDurationMS); |
384 progress_animation_->StartThrobbing(-1); | 384 progress_animation_->StartThrobbing(-1); |
385 } | 385 } |
OLD | NEW |