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

Side by Side Diff: chrome/browser/views/status_bubble_views.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « chrome/browser/views/shell_dialogs_win.cc ('k') | chrome/browser/views/tabs/base_tab.cc » ('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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/views/shell_dialogs_win.cc ('k') | chrome/browser/views/tabs/base_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698