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

Side by Side Diff: chrome/browser/views/options/languages_page_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/options/fonts_page_view.cc ('k') | chrome/browser/views/sad_tab_view.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 <windows.h> 5 #include <windows.h>
6 #include <shlobj.h> 6 #include <shlobj.h>
7 #include <vsstyle.h> 7 #include <vsstyle.h>
8 #include <vssym32.h> 8 #include <vssym32.h>
9 9
10 #include "chrome/browser/views/options/languages_page_view.h" 10 #include "chrome/browser/views/options/languages_page_view.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 void AddLanguageWindowView::Layout() { 135 void AddLanguageWindowView::Layout() {
136 gfx::Size sz = accept_language_combobox_->GetPreferredSize(); 136 gfx::Size sz = accept_language_combobox_->GetPreferredSize();
137 accept_language_combobox_->SetBounds(kDialogPadding, kDialogPadding, 137 accept_language_combobox_->SetBounds(kDialogPadding, kDialogPadding,
138 width() - 2*kDialogPadding, 138 width() - 2*kDialogPadding,
139 sz.height()); 139 sz.height());
140 } 140 }
141 141
142 gfx::Size AddLanguageWindowView::GetPreferredSize() { 142 gfx::Size AddLanguageWindowView::GetPreferredSize() {
143 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 143 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
144 const gfx::Font& font = rb.GetFont(ResourceBundle::BaseFont); 144 const gfx::Font& font = rb.GetFont(ResourceBundle::BaseFont);
145 return gfx::Size(font.ave_char_width() * kDefaultWindowWidthChars, 145 return gfx::Size(font.GetAverageCharacterWidth() * kDefaultWindowWidthChars,
146 font.height() * kDefaultWindowHeightLines); 146 font.GetHeight() * kDefaultWindowHeightLines);
147 } 147 }
148 148
149 void AddLanguageWindowView::ViewHierarchyChanged(bool is_add, 149 void AddLanguageWindowView::ViewHierarchyChanged(bool is_add,
150 views::View* parent, 150 views::View* parent,
151 views::View* child) { 151 views::View* child) {
152 // Can't init before we're inserted into a Widget, because we require 152 // Can't init before we're inserted into a Widget, because we require
153 // a HWND to parent native child controls to. 153 // a HWND to parent native child controls to.
154 if (is_add && child == this) 154 if (is_add && child == this)
155 Init(); 155 Init();
156 } 156 }
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 } 570 }
571 571
572 if (enable_spellcheck_checkbox_clicked_) 572 if (enable_spellcheck_checkbox_clicked_)
573 enable_spellcheck_.SetValue(enable_spellchecking_checkbox_->checked()); 573 enable_spellcheck_.SetValue(enable_spellchecking_checkbox_->checked());
574 574
575 if (enable_autospellcorrect_checkbox_clicked_) { 575 if (enable_autospellcorrect_checkbox_clicked_) {
576 enable_autospellcorrect_.SetValue( 576 enable_autospellcorrect_.SetValue(
577 enable_autospellcorrect_checkbox_->checked()); 577 enable_autospellcorrect_checkbox_->checked());
578 } 578 }
579 } 579 }
OLDNEW
« no previous file with comments | « chrome/browser/views/options/fonts_page_view.cc ('k') | chrome/browser/views/sad_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698