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

Side by Side Diff: chrome/views/controls/label.cc

Issue 93085: Removes the use of Windows-specific types for accessibility roles and states ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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/views/controls/label.h ('k') | chrome/views/controls/label_unittest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/controls/label.h" 5 #include "chrome/views/controls/label.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 gfx::Insets insets = GetInsets(); 404 gfx::Insets insets = GetInsets();
405 label_width += insets.width(); 405 label_width += insets.width();
406 406
407 if (max_width > 0) 407 if (max_width > 0)
408 label_width = std::min(label_width, max_width); 408 label_width = std::min(label_width, max_width);
409 409
410 SetBounds(x(), y(), label_width, 0); 410 SetBounds(x(), y(), label_width, 0);
411 SizeToPreferredSize(); 411 SizeToPreferredSize();
412 } 412 }
413 413
414 #if defined(OS_WIN) 414 bool Label::GetAccessibleRole(AccessibilityTypes::Role* role) {
415 bool Label::GetAccessibleRole(VARIANT* role) {
416 DCHECK(role); 415 DCHECK(role);
417 416
418 role->vt = VT_I4; 417 *role = AccessibilityTypes::ROLE_TEXT;
419 role->lVal = ROLE_SYSTEM_TEXT;
420 return true; 418 return true;
421 } 419 }
422 420
423 bool Label::GetAccessibleName(std::wstring* name) { 421 bool Label::GetAccessibleName(std::wstring* name) {
424 *name = GetText(); 422 *name = GetText();
425 return true; 423 return true;
426 } 424 }
427 425
428 bool Label::GetAccessibleState(VARIANT* state) { 426 bool Label::GetAccessibleState(AccessibilityTypes::State* state) {
429 DCHECK(state); 427 DCHECK(state);
430 428
431 state->lVal |= STATE_SYSTEM_READONLY; 429 *state = AccessibilityTypes::STATE_READONLY;
432 return true; 430 return true;
433 } 431 }
434 #endif // defined(OS_WIN)
435 432
436 } // namespace views 433 } // namespace views
OLDNEW
« no previous file with comments | « chrome/views/controls/label.h ('k') | chrome/views/controls/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698