| OLD | NEW |
| 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/label.h" | 5 #include "ui/views/controls/label.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 bool Label::CanProcessEventsWithinSubtree() const { | 396 bool Label::CanProcessEventsWithinSubtree() const { |
| 397 return !!GetRenderTextForSelectionController(); | 397 return !!GetRenderTextForSelectionController(); |
| 398 } | 398 } |
| 399 | 399 |
| 400 WordLookupClient* Label::GetWordLookupClient() { | 400 WordLookupClient* Label::GetWordLookupClient() { |
| 401 return this; | 401 return this; |
| 402 } | 402 } |
| 403 | 403 |
| 404 void Label::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 404 void Label::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 405 node_data->role = ui::AX_ROLE_STATIC_TEXT; | 405 node_data->role = ui::AX_ROLE_STATIC_TEXT; |
| 406 node_data->AddStateFlag(ui::AX_STATE_READ_ONLY); | 406 node_data->AddState(ui::AX_STATE_READ_ONLY); |
| 407 // Note that |render_text_| is never elided (see the comment in Init() too). | 407 // Note that |render_text_| is never elided (see the comment in Init() too). |
| 408 node_data->SetName(render_text_->GetDisplayText()); | 408 node_data->SetName(render_text_->GetDisplayText()); |
| 409 } | 409 } |
| 410 | 410 |
| 411 bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const { | 411 bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const { |
| 412 if (!handles_tooltips_) | 412 if (!handles_tooltips_) |
| 413 return false; | 413 return false; |
| 414 | 414 |
| 415 if (!tooltip_text_.empty()) { | 415 if (!tooltip_text_.empty()) { |
| 416 tooltip->assign(tooltip_text_); | 416 tooltip->assign(tooltip_text_); |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 .WriteText(GetSelectedText()); | 1054 .WriteText(GetSelectedText()); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 void Label::BuildContextMenuContents() { | 1057 void Label::BuildContextMenuContents() { |
| 1058 context_menu_contents_.AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY); | 1058 context_menu_contents_.AddItemWithStringId(IDS_APP_COPY, IDS_APP_COPY); |
| 1059 context_menu_contents_.AddItemWithStringId(IDS_APP_SELECT_ALL, | 1059 context_menu_contents_.AddItemWithStringId(IDS_APP_SELECT_ALL, |
| 1060 IDS_APP_SELECT_ALL); | 1060 IDS_APP_SELECT_ALL); |
| 1061 } | 1061 } |
| 1062 | 1062 |
| 1063 } // namespace views | 1063 } // namespace views |
| OLD | NEW |