| 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 <gtk/gtk.h> | 5 #include <gtk/gtk.h> |
| 6 | 6 |
| 7 #include "views/controls/textfield/native_textfield_gtk.h" | 7 #include "views/controls/textfield/native_textfield_gtk.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 !textfield_->read_only()); | 228 !textfield_->read_only()); |
| 229 } else { | 229 } else { |
| 230 gtk_editable_set_editable(GTK_EDITABLE(native_view()), | 230 gtk_editable_set_editable(GTK_EDITABLE(native_view()), |
| 231 !textfield_->read_only()); | 231 !textfield_->read_only()); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void NativeTextfieldGtk::UpdateFont() { | 235 void NativeTextfieldGtk::UpdateFont() { |
| 236 if (!native_view()) | 236 if (!native_view()) |
| 237 return; | 237 return; |
| 238 PangoFontDescription* pfd = | 238 PangoFontDescription* pfd = textfield_->font().GetNativeFont(); |
| 239 gfx::Font::PangoFontFromGfxFont(textfield_->font()); | |
| 240 gtk_widget_modify_font(native_view(), pfd); | 239 gtk_widget_modify_font(native_view(), pfd); |
| 241 pango_font_description_free(pfd); | 240 pango_font_description_free(pfd); |
| 242 } | 241 } |
| 243 | 242 |
| 244 void NativeTextfieldGtk::UpdateIsPassword() { | 243 void NativeTextfieldGtk::UpdateIsPassword() { |
| 245 if (!native_view()) | 244 if (!native_view()) |
| 246 return; | 245 return; |
| 247 if (!textfield_->IsMultiLine()) { | 246 if (!textfield_->IsMultiLine()) { |
| 248 gtk_entry_set_visibility(GTK_ENTRY(native_view()), | 247 gtk_entry_set_visibility(GTK_ENTRY(native_view()), |
| 249 !textfield_->IsPassword()); | 248 !textfield_->IsPassword()); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 //////////////////////////////////////////////////////////////////////////////// | 387 //////////////////////////////////////////////////////////////////////////////// |
| 389 // NativeTextfieldWrapper, public: | 388 // NativeTextfieldWrapper, public: |
| 390 | 389 |
| 391 // static | 390 // static |
| 392 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 391 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
| 393 Textfield* field) { | 392 Textfield* field) { |
| 394 return new NativeTextfieldGtk(field); | 393 return new NativeTextfieldGtk(field); |
| 395 } | 394 } |
| 396 | 395 |
| 397 } // namespace views | 396 } // namespace views |
| OLD | NEW |