OLD | NEW |
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/status_bubble_views.h" | 5 #include "chrome/browser/views/status_bubble_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/linear_animation.h" | 9 #include "app/linear_animation.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 gfx::Point top_left; | 587 gfx::Point top_left; |
588 views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); | 588 views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); |
589 popup_->SetBounds(gfx::Rect(top_left.x() + xpos, | 589 popup_->SetBounds(gfx::Rect(top_left.x() + xpos, |
590 top_left.y() + position_.y(), | 590 top_left.y() + position_.y(), |
591 size_.width(), size_.height())); | 591 size_.width(), size_.height())); |
592 } | 592 } |
593 } | 593 } |
594 | 594 |
595 gfx::Size StatusBubbleViews::GetPreferredSize() { | 595 gfx::Size StatusBubbleViews::GetPreferredSize() { |
596 return gfx::Size(0, ResourceBundle::GetSharedInstance().GetFont( | 596 return gfx::Size(0, ResourceBundle::GetSharedInstance().GetFont( |
597 ResourceBundle::BaseFont).height() + kTotalVerticalPadding); | 597 ResourceBundle::BaseFont).GetHeight() + kTotalVerticalPadding); |
598 } | 598 } |
599 | 599 |
600 void StatusBubbleViews::SetBounds(int x, int y, int w, int h) { | 600 void StatusBubbleViews::SetBounds(int x, int y, int w, int h) { |
601 position_.SetPoint(x, y); | 601 position_.SetPoint(x, y); |
602 size_.SetSize(w, h); | 602 size_.SetSize(w, h); |
603 Reposition(); | 603 Reposition(); |
604 } | 604 } |
605 | 605 |
606 void StatusBubbleViews::SetStatus(const std::wstring& status_text) { | 606 void StatusBubbleViews::SetStatus(const std::wstring& status_text) { |
607 if (size_.IsEmpty()) | 607 if (size_.IsEmpty()) |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 | 835 |
836 void StatusBubbleViews::SetBubbleWidth(int width) { | 836 void StatusBubbleViews::SetBubbleWidth(int width) { |
837 size_.set_width(width); | 837 size_.set_width(width); |
838 SetBounds(position_.x(), position_.y(), size_.width(), size_.height()); | 838 SetBounds(position_.x(), position_.y(), size_.width(), size_.height()); |
839 } | 839 } |
840 | 840 |
841 void StatusBubbleViews::CancelExpandTimer() { | 841 void StatusBubbleViews::CancelExpandTimer() { |
842 if (!expand_timer_factory_.empty()) | 842 if (!expand_timer_factory_.empty()) |
843 expand_timer_factory_.RevokeAll(); | 843 expand_timer_factory_.RevokeAll(); |
844 } | 844 } |
OLD | NEW |