| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 bubble_->GetWidget()->Close(); | 123 bubble_->GetWidget()->Close(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 views::View* ChromeToMobileBubbleView::GetInitiallyFocusedView() { | 126 views::View* ChromeToMobileBubbleView::GetInitiallyFocusedView() { |
| 127 return send_; | 127 return send_; |
| 128 } | 128 } |
| 129 | 129 |
| 130 void ChromeToMobileBubbleView::WindowClosing() { | 130 void ChromeToMobileBubbleView::WindowClosing() { |
| 131 // We have to reset |bubble_| here, not in our destructor, because we'll be | 131 // We have to reset |bubble_| here, not in our destructor, because we'll be |
| 132 // destroyed asynchronously and the shown state will be checked before then. | 132 // destroyed asynchronously and the shown state will be checked before then. |
| 133 DCHECK(bubble_ == this); | 133 DCHECK_EQ(bubble_, this); |
| 134 bubble_ = NULL; | 134 bubble_ = NULL; |
| 135 | 135 |
| 136 // Instruct the service to delete the snapshot file. | 136 // Instruct the service to delete the snapshot file. |
| 137 service_->DeleteSnapshot(snapshot_path_); | 137 service_->DeleteSnapshot(snapshot_path_); |
| 138 | 138 |
| 139 // Restore the resting state action box icon. | 139 // Restore the resting state action box icon. |
| 140 SetTextButtonIconToId(anchor_view(), IDR_ACTION_BOX_BUTTON); | 140 SetTextButtonIconToId(anchor_view(), IDR_ACTION_BOX_BUTTON); |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool ChromeToMobileBubbleView::AcceleratorPressed( | 143 bool ChromeToMobileBubbleView::AcceleratorPressed( |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 | 368 |
| 369 // Update the view's contents to show the "Sending..." progress animation. | 369 // Update the view's contents to show the "Sending..." progress animation. |
| 370 cancel_->SetEnabled(false); | 370 cancel_->SetEnabled(false); |
| 371 send_->SetEnabled(false); | 371 send_->SetEnabled(false); |
| 372 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); | 372 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); |
| 373 progress_animation_.reset(new ui::ThrobAnimation(this)); | 373 progress_animation_.reset(new ui::ThrobAnimation(this)); |
| 374 progress_animation_->SetDuration(kProgressThrobDurationMS); | 374 progress_animation_->SetDuration(kProgressThrobDurationMS); |
| 375 progress_animation_->StartThrobbing(-1); | 375 progress_animation_->StartThrobbing(-1); |
| 376 } | 376 } |
| OLD | NEW |