| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/views/extensions/extension_message_bubble_view.h" | 5 #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/location.h" | 9 #include "base/location.h" |
| 8 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
| 11 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 13 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 12 #include "chrome/browser/ui/view_ids.h" | 14 #include "chrome/browser/ui/view_ids.h" |
| 13 #include "chrome/grit/locale_settings.h" | 15 #include "chrome/grit/locale_settings.h" |
| 14 #include "ui/accessibility/ax_view_state.h" | 16 #include "ui/accessibility/ax_view_state.h" |
| 15 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 16 #include "ui/views/controls/button/label_button.h" | 18 #include "ui/views/controls/button/label_button.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 } // namespace | 39 } // namespace |
| 38 | 40 |
| 39 namespace extensions { | 41 namespace extensions { |
| 40 | 42 |
| 41 ExtensionMessageBubbleView::ExtensionMessageBubbleView( | 43 ExtensionMessageBubbleView::ExtensionMessageBubbleView( |
| 42 views::View* anchor_view, | 44 views::View* anchor_view, |
| 43 views::BubbleBorder::Arrow arrow_location, | 45 views::BubbleBorder::Arrow arrow_location, |
| 44 scoped_ptr<extensions::ExtensionMessageBubbleController> controller) | 46 scoped_ptr<extensions::ExtensionMessageBubbleController> controller) |
| 45 : BubbleDelegateView(anchor_view, arrow_location), | 47 : BubbleDelegateView(anchor_view, arrow_location), |
| 46 controller_(controller.Pass()), | 48 controller_(std::move(controller)), |
| 47 anchor_view_(anchor_view), | 49 anchor_view_(anchor_view), |
| 48 headline_(NULL), | 50 headline_(NULL), |
| 49 learn_more_(NULL), | 51 learn_more_(NULL), |
| 50 dismiss_button_(NULL), | 52 dismiss_button_(NULL), |
| 51 link_clicked_(false), | 53 link_clicked_(false), |
| 52 action_taken_(false), | 54 action_taken_(false), |
| 53 weak_factory_(this) { | 55 weak_factory_(this) { |
| 54 DCHECK(anchor_view->GetWidget()); | 56 DCHECK(anchor_view->GetWidget()); |
| 55 set_close_on_deactivate(controller_->CloseOnDeactivate()); | 57 set_close_on_deactivate(controller_->CloseOnDeactivate()); |
| 56 set_close_on_esc(true); | 58 set_close_on_esc(true); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 state->role = ui::AX_ROLE_ALERT; | 225 state->role = ui::AX_ROLE_ALERT; |
| 224 } | 226 } |
| 225 | 227 |
| 226 void ExtensionMessageBubbleView::ViewHierarchyChanged( | 228 void ExtensionMessageBubbleView::ViewHierarchyChanged( |
| 227 const ViewHierarchyChangedDetails& details) { | 229 const ViewHierarchyChangedDetails& details) { |
| 228 if (details.is_add && details.child == this) | 230 if (details.is_add && details.child == this) |
| 229 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 231 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 230 } | 232 } |
| 231 | 233 |
| 232 } // namespace extensions | 234 } // namespace extensions |
| OLD | NEW |