Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: chrome/browser/ui/views/chrome_to_mobile_bubble_view.cc

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 164 }
165 Layout(); 165 Layout();
166 } 166 }
167 167
168 void ChromeToMobileBubbleView::OnSendComplete(bool success) { 168 void ChromeToMobileBubbleView::OnSendComplete(bool success) {
169 progress_animation_->Stop(); 169 progress_animation_->Stop();
170 send_->SetHorizontalAlignment(gfx::ALIGN_CENTER); 170 send_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
171 171
172 if (success) { 172 if (success) {
173 send_->SetText(l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SENT)); 173 send_->SetText(l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_SENT));
174 MessageLoop::current()->PostDelayedTask(FROM_HERE, 174 base::MessageLoop::current()->PostDelayedTask(
175 FROM_HERE,
175 base::Bind(&ChromeToMobileBubbleView::Hide), 176 base::Bind(&ChromeToMobileBubbleView::Hide),
176 base::TimeDelta::FromSeconds(kAutoCloseDelay)); 177 base::TimeDelta::FromSeconds(kAutoCloseDelay));
177 } else { 178 } else {
178 send_->SetText( 179 send_->SetText(
179 l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR)); 180 l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR));
180 views::Label* error_label = new views::Label( 181 views::Label* error_label = new views::Label(
181 l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR_MESSAGE)); 182 l10n_util::GetStringUTF16(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR_MESSAGE));
182 error_label->SetEnabledColor(SK_ColorRED); 183 error_label->SetEnabledColor(SK_ColorRED);
183 GridLayout* layout = static_cast<GridLayout*>(GetLayoutManager()); 184 GridLayout* layout = static_cast<GridLayout*>(GetLayoutManager());
184 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing); 185 layout->AddPaddingRow(0, views::kRelatedControlSmallVerticalSpacing);
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 347 }
347 348
348 // Update the view's contents to show the "Sending..." progress animation. 349 // Update the view's contents to show the "Sending..." progress animation.
349 cancel_->SetEnabled(false); 350 cancel_->SetEnabled(false);
350 send_->SetEnabled(false); 351 send_->SetEnabled(false);
351 send_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 352 send_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
352 progress_animation_.reset(new ui::ThrobAnimation(this)); 353 progress_animation_.reset(new ui::ThrobAnimation(this));
353 progress_animation_->SetDuration(kProgressThrobDurationMS); 354 progress_animation_->SetDuration(kProgressThrobDurationMS);
354 progress_animation_->StartThrobbing(-1); 355 progress_animation_->StartThrobbing(-1);
355 } 356 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/button_dropdown_test.cc ('k') | chrome/browser/ui/views/download/download_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698