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

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

Issue 117983002: Prefix string16 with base:: in ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years 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 | « ui/views/controls/slider.h ('k') | ui/views/controls/styled_label.h » ('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/slider.h" 5 #include "ui/views/controls/slider.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 images_[i] = rb.GetImageNamed(bar_active_images_[i]).ToImageSkia(); 160 images_[i] = rb.GetImageNamed(bar_active_images_[i]).ToImageSkia();
161 } else { 161 } else {
162 thumb_ = rb.GetImageNamed(IDR_SLIDER_DISABLED_THUMB).ToImageSkia(); 162 thumb_ = rb.GetImageNamed(IDR_SLIDER_DISABLED_THUMB).ToImageSkia();
163 for (int i = 0; i < 4; ++i) 163 for (int i = 0; i < 4; ++i)
164 images_[i] = rb.GetImageNamed(bar_disabled_images_[i]).ToImageSkia(); 164 images_[i] = rb.GetImageNamed(bar_disabled_images_[i]).ToImageSkia();
165 } 165 }
166 bar_height_ = images_[LEFT]->height(); 166 bar_height_ = images_[LEFT]->height();
167 SchedulePaint(); 167 SchedulePaint();
168 } 168 }
169 169
170 void Slider::SetAccessibleName(const string16& name) { 170 void Slider::SetAccessibleName(const base::string16& name) {
171 accessible_name_ = name; 171 accessible_name_ = name;
172 } 172 }
173 173
174 void Slider::OnPaintFocus(gfx::Canvas* canvas) { 174 void Slider::OnPaintFocus(gfx::Canvas* canvas) {
175 if (!HasFocus()) 175 if (!HasFocus())
176 return; 176 return;
177 177
178 if (!focus_border_color_) { 178 if (!focus_border_color_) {
179 canvas->DrawFocusRect(GetLocalBounds()); 179 canvas->DrawFocusRect(GetLocalBounds());
180 } else if (HasFocus()) { 180 } else if (HasFocus()) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 void Slider::GetAccessibleState(ui::AccessibleViewState* state) { 326 void Slider::GetAccessibleState(ui::AccessibleViewState* state) {
327 state->role = ui::AccessibilityTypes::ROLE_SLIDER; 327 state->role = ui::AccessibilityTypes::ROLE_SLIDER;
328 state->name = accessible_name_; 328 state->name = accessible_name_;
329 state->value = UTF8ToUTF16( 329 state->value = UTF8ToUTF16(
330 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5))); 330 base::StringPrintf("%d%%", (int)(value_ * 100 + 0.5)));
331 } 331 }
332 332
333 } // namespace views 333 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/slider.h ('k') | ui/views/controls/styled_label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698