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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 ChromeToMobileBubbleView::ChromeToMobileBubbleView(views::View* anchor_view, | 293 ChromeToMobileBubbleView::ChromeToMobileBubbleView(views::View* anchor_view, |
294 Browser* browser) | 294 Browser* browser) |
295 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 295 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
296 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), | 296 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
297 browser_(browser), | 297 browser_(browser), |
298 service_(ChromeToMobileServiceFactory::GetForProfile(browser->profile())), | 298 service_(ChromeToMobileServiceFactory::GetForProfile(browser->profile())), |
299 send_copy_(NULL), | 299 send_copy_(NULL), |
300 send_(NULL), | 300 send_(NULL), |
301 cancel_(NULL) { | 301 cancel_(NULL) { |
302 // Compensate for built-in vertical padding in the anchor view's image. | 302 // Compensate for built-in vertical padding in the anchor view's image. |
303 set_anchor_insets(gfx::Insets(5, 0, 5, 0)); | 303 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0)); |
304 | 304 |
305 // Generate the MHTML snapshot now to report its size in the bubble. | 305 // Generate the MHTML snapshot now to report its size in the bubble. |
306 service_->GenerateSnapshot(browser_, weak_ptr_factory_.GetWeakPtr()); | 306 service_->GenerateSnapshot(browser_, weak_ptr_factory_.GetWeakPtr()); |
307 } | 307 } |
308 | 308 |
309 void ChromeToMobileBubbleView::LinkClicked(views::Link* source, | 309 void ChromeToMobileBubbleView::LinkClicked(views::Link* source, |
310 int event_flags) { | 310 int event_flags) { |
311 service_->LearnMore(browser_); | 311 service_->LearnMore(browser_); |
312 GetWidget()->Close(); | 312 GetWidget()->Close(); |
313 } | 313 } |
(...skipping 30 matching lines...) Expand all Loading... |
344 } | 344 } |
345 | 345 |
346 // Update the view's contents to show the "Sending..." progress animation. | 346 // Update the view's contents to show the "Sending..." progress animation. |
347 cancel_->SetEnabled(false); | 347 cancel_->SetEnabled(false); |
348 send_->SetEnabled(false); | 348 send_->SetEnabled(false); |
349 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); | 349 send_->set_alignment(views::TextButtonBase::ALIGN_LEFT); |
350 progress_animation_.reset(new ui::ThrobAnimation(this)); | 350 progress_animation_.reset(new ui::ThrobAnimation(this)); |
351 progress_animation_->SetDuration(kProgressThrobDurationMS); | 351 progress_animation_->SetDuration(kProgressThrobDurationMS); |
352 progress_animation_->StartThrobbing(-1); | 352 progress_animation_->StartThrobbing(-1); |
353 } | 353 } |
OLD | NEW |