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

Side by Side Diff: ui/views/controls/combobox/combobox.cc

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix transcription error Created 4 years, 10 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
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/label.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/combobox/combobox.h" 5 #include "ui/views/controls/combobox/combobox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "ui/accessibility/ax_view_state.h" 14 #include "ui/accessibility/ax_view_state.h"
15 #include "ui/base/default_style.h"
15 #include "ui/base/ime/input_method.h" 16 #include "ui/base/ime/input_method.h"
16 #include "ui/base/models/combobox_model.h" 17 #include "ui/base/models/combobox_model.h"
17 #include "ui/base/models/combobox_model_observer.h" 18 #include "ui/base/models/combobox_model_observer.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/events/event.h" 20 #include "ui/events/event.h"
20 #include "ui/gfx/animation/throb_animation.h" 21 #include "ui/gfx/animation/throb_animation.h"
21 #include "ui/gfx/canvas.h" 22 #include "ui/gfx/canvas.h"
22 #include "ui/gfx/color_palette.h" 23 #include "ui/gfx/color_palette.h"
23 #include "ui/gfx/scoped_canvas.h" 24 #include "ui/gfx/scoped_canvas.h"
24 #include "ui/gfx/text_utils.h" 25 #include "ui/gfx/text_utils.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 Combobox::~Combobox() { 385 Combobox::~Combobox() {
385 if (GetInputMethod() && selector_.get()) { 386 if (GetInputMethod() && selector_.get()) {
386 // Combobox should have been blurred before destroy. 387 // Combobox should have been blurred before destroy.
387 DCHECK(selector_.get() != GetInputMethod()->GetTextInputClient()); 388 DCHECK(selector_.get() != GetInputMethod()->GetTextInputClient());
388 } 389 }
389 } 390 }
390 391
391 // static 392 // static
392 const gfx::FontList& Combobox::GetFontList() { 393 const gfx::FontList& Combobox::GetFontList() {
393 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 394 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
394 return rb.GetFontList(ui::ResourceBundle::BaseFont); 395 return rb.GetFontListWithDelta(ui::kLabelFontSizeDelta);
395 } 396 }
396 397
397 void Combobox::SetStyle(Style style) { 398 void Combobox::SetStyle(Style style) {
398 if (style_ == style) 399 if (style_ == style)
399 return; 400 return;
400 401
401 style_ = style; 402 style_ = style;
402 if (style_ == STYLE_ACTION) 403 if (style_ == STYLE_ACTION)
403 selected_index_ = 0; 404 selected_index_ = 0;
404 405
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 return gfx::Size(width, font_list.GetHeight()); 927 return gfx::Size(width, font_list.GetHeight());
927 } 928 }
928 929
929 PrefixSelector* Combobox::GetPrefixSelector() { 930 PrefixSelector* Combobox::GetPrefixSelector() {
930 if (!selector_) 931 if (!selector_)
931 selector_.reset(new PrefixSelector(this)); 932 selector_.reset(new PrefixSelector(this));
932 return selector_.get(); 933 return selector_.get();
933 } 934 }
934 935
935 } // namespace views 936 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698