| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/chromeos/status/status_area_bubble.h" | 5 #include "chrome/browser/chromeos/status/status_area_bubble.h" |
| 6 | 6 |
| 7 #include "views/controls/label.h" | 7 #include "views/controls/label.h" |
| 8 #include "views/layout/box_layout.h" | 8 #include "views/layout/box_layout.h" |
| 9 #include "views/layout/fill_layout.h" | 9 #include "views/layout/fill_layout.h" |
| 10 #include "ui/base/accessibility/accessible_view_state.h" |
| 10 | 11 |
| 11 namespace chromeos { | 12 namespace chromeos { |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 const size_t kCloseBubbleTimerInSec = 5; | 16 const size_t kCloseBubbleTimerInSec = 5; |
| 16 | 17 |
| 17 class CloseBubbleWhenClickedView : public views::View { | 18 class CloseBubbleWhenClickedView : public views::View { |
| 18 public: | 19 public: |
| 19 explicit CloseBubbleWhenClickedView(StatusAreaBubbleController* controller) | 20 explicit CloseBubbleWhenClickedView(StatusAreaBubbleController* controller) |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 61 } |
| 61 | 62 |
| 62 string16 StatusAreaBubbleContentView::GetMessage() const { | 63 string16 StatusAreaBubbleContentView::GetMessage() const { |
| 63 return message_view_->GetText(); | 64 return message_view_->GetText(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void StatusAreaBubbleContentView::SetMessage(const string16& message) { | 67 void StatusAreaBubbleContentView::SetMessage(const string16& message) { |
| 67 message_view_->SetText(message); | 68 message_view_->SetText(message); |
| 68 } | 69 } |
| 69 | 70 |
| 71 void StatusAreaBubbleContentView::GetAccessibleState( |
| 72 ui::AccessibleViewState* state) { |
| 73 state->role = ui::AccessibilityTypes::ROLE_STATICTEXT; |
| 74 state->state = ui::AccessibilityTypes::STATE_READONLY; |
| 75 state->name = GetMessage(); |
| 76 } |
| 77 |
| 70 | 78 |
| 71 StatusAreaBubbleController::StatusAreaBubbleController() | 79 StatusAreaBubbleController::StatusAreaBubbleController() |
| 72 : bubble_(NULL), content_(NULL) { | 80 : bubble_(NULL), content_(NULL) { |
| 73 } | 81 } |
| 74 | 82 |
| 75 StatusAreaBubbleController::~StatusAreaBubbleController() { | 83 StatusAreaBubbleController::~StatusAreaBubbleController() { |
| 76 HideBubble(); | 84 HideBubble(); |
| 77 } | 85 } |
| 78 | 86 |
| 79 // static | 87 // static |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 133 |
| 126 bool StatusAreaBubbleController::FadeInOnShow() { | 134 bool StatusAreaBubbleController::FadeInOnShow() { |
| 127 return false; | 135 return false; |
| 128 } | 136 } |
| 129 | 137 |
| 130 string16 StatusAreaBubbleController::GetAccessibleName() { | 138 string16 StatusAreaBubbleController::GetAccessibleName() { |
| 131 return content_->GetMessage(); | 139 return content_->GetMessage(); |
| 132 } | 140 } |
| 133 | 141 |
| 134 } // namespace chromeos | 142 } // namespace chromeos |
| OLD | NEW |