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

Side by Side Diff: chrome/browser/views/theme_install_bubble_view.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/tabs/base_tab.cc ('k') | chrome/common/extensions/extension_action.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/theme_install_bubble_view.h" 5 #include "chrome/browser/views/theme_install_bubble_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "chrome/browser/tab_contents/tab_contents.h" 9 #include "chrome/browser/tab_contents/tab_contents.h"
10 #include "gfx/canvas_skia.h" 10 #include "gfx/canvas_skia.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 83 }
84 84
85 ThemeInstallBubbleView::~ThemeInstallBubbleView() { 85 ThemeInstallBubbleView::~ThemeInstallBubbleView() {
86 num_loads_extant_ = 0; 86 num_loads_extant_ = 0;
87 } 87 }
88 88
89 gfx::Size ThemeInstallBubbleView::GetPreferredSize() { 89 gfx::Size ThemeInstallBubbleView::GetPreferredSize() {
90 return gfx::Size(views::Label::font().GetStringWidth(text_) + 90 return gfx::Size(views::Label::font().GetStringWidth(text_) +
91 kTextHorizPadding, 91 kTextHorizPadding,
92 ResourceBundle::GetSharedInstance().GetFont( 92 ResourceBundle::GetSharedInstance().GetFont(
93 ResourceBundle::LargeFont).height() + kTextVertPadding); 93 ResourceBundle::LargeFont).GetHeight() + kTextVertPadding);
94 } 94 }
95 95
96 void ThemeInstallBubbleView::Reposition() { 96 void ThemeInstallBubbleView::Reposition() {
97 if (!popup_) 97 if (!popup_)
98 Close(); 98 Close();
99 99
100 gfx::Size size = GetPreferredSize(); 100 gfx::Size size = GetPreferredSize();
101 int mid_x = tab_contents_bounds_.x() + 101 int mid_x = tab_contents_bounds_.x() +
102 (tab_contents_bounds_.right() - tab_contents_bounds_.x()) / 2; 102 (tab_contents_bounds_.right() - tab_contents_bounds_.x()) / 2;
103 103
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 Close(); 156 Close();
157 } 157 }
158 158
159 // static 159 // static
160 void ThemeInstallBubbleView::Show(TabContents* tab_contents) { 160 void ThemeInstallBubbleView::Show(TabContents* tab_contents) {
161 ++num_loads_extant_; 161 ++num_loads_extant_;
162 if (num_loads_extant_ < 2) 162 if (num_loads_extant_ < 2)
163 new ThemeInstallBubbleView(tab_contents); 163 new ThemeInstallBubbleView(tab_contents);
164 } 164 }
165 165
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/base_tab.cc ('k') | chrome/common/extensions/extension_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698