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

Side by Side Diff: chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 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
« no previous file with comments | « chrome/browser/gtk/translate_infobars.cc ('k') | chrome/browser/views/bookmark_bar_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/views/autocomplete/autocomplete_popup_contents_view.h" 5 #include "chrome/browser/views/autocomplete/autocomplete_popup_contents_view.h"
6 6
7 #include "app/bidi_line_iterator.h" 7 #include "app/bidi_line_iterator.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "app/theme_provider.h" 10 #include "app/theme_provider.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 set_border(bubble_border); 515 set_border(bubble_border);
516 } 516 }
517 517
518 AutocompletePopupContentsView::~AutocompletePopupContentsView() { 518 AutocompletePopupContentsView::~AutocompletePopupContentsView() {
519 // We don't need to do anything with |popup_| here. The OS either has already 519 // We don't need to do anything with |popup_| here. The OS either has already
520 // closed the window, in which case it's been deleted, or it will soon, in 520 // closed the window, in which case it's been deleted, or it will soon, in
521 // which case there's nothing we need to do. 521 // which case there's nothing we need to do.
522 } 522 }
523 523
524 gfx::Rect AutocompletePopupContentsView::GetPopupBounds() const { 524 gfx::Rect AutocompletePopupContentsView::GetPopupBounds() const {
525 if (!size_animation_.IsAnimating()) 525 if (!size_animation_.is_animating())
526 return target_bounds_; 526 return target_bounds_;
527 527
528 gfx::Rect current_frame_bounds = start_bounds_; 528 gfx::Rect current_frame_bounds = start_bounds_;
529 int total_height_delta = target_bounds_.height() - start_bounds_.height(); 529 int total_height_delta = target_bounds_.height() - start_bounds_.height();
530 // Round |current_height_delta| instead of truncating so we won't leave single 530 // Round |current_height_delta| instead of truncating so we won't leave single
531 // white pixels at the bottom of the popup as long when animating very small 531 // white pixels at the bottom of the popup as long when animating very small
532 // height differences. 532 // height differences.
533 int current_height_delta = static_cast<int>( 533 int current_height_delta = static_cast<int>(
534 size_animation_.GetCurrentValue() * total_height_delta - 0.5); 534 size_animation_.GetCurrentValue() * total_height_delta - 0.5);
535 current_frame_bounds.set_height( 535 current_frame_bounds.set_height(
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 DCHECK(nb_match <= GetChildViewCount()); 888 DCHECK(nb_match <= GetChildViewCount());
889 for (int i = 0; i < nb_match; ++i) { 889 for (int i = 0; i < nb_match; ++i) {
890 views::View* child = GetChildViewAt(i); 890 views::View* child = GetChildViewAt(i);
891 gfx::Point point_in_child_coords(point); 891 gfx::Point point_in_child_coords(point);
892 View::ConvertPointToView(this, child, &point_in_child_coords); 892 View::ConvertPointToView(this, child, &point_in_child_coords);
893 if (child->HitTest(point_in_child_coords)) 893 if (child->HitTest(point_in_child_coords))
894 return i; 894 return i;
895 } 895 }
896 return AutocompletePopupModel::kNoMatch; 896 return AutocompletePopupModel::kNoMatch;
897 } 897 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/translate_infobars.cc ('k') | chrome/browser/views/bookmark_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698