| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/app_list/views/start_page_view.h" | 5 #include "ui/app_list/views/start_page_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "ui/accessibility/ax_view_state.h" | 14 #include "ui/accessibility/ax_node_data.h" |
| 15 #include "ui/app_list/app_list_constants.h" | 15 #include "ui/app_list/app_list_constants.h" |
| 16 #include "ui/app_list/app_list_item.h" | 16 #include "ui/app_list/app_list_item.h" |
| 17 #include "ui/app_list/app_list_model.h" | 17 #include "ui/app_list/app_list_model.h" |
| 18 #include "ui/app_list/app_list_view_delegate.h" | 18 #include "ui/app_list/app_list_view_delegate.h" |
| 19 #include "ui/app_list/search_result.h" | 19 #include "ui/app_list/search_result.h" |
| 20 #include "ui/app_list/views/all_apps_tile_item_view.h" | 20 #include "ui/app_list/views/all_apps_tile_item_view.h" |
| 21 #include "ui/app_list/views/app_list_main_view.h" | 21 #include "ui/app_list/views/app_list_main_view.h" |
| 22 #include "ui/app_list/views/contents_view.h" | 22 #include "ui/app_list/views/contents_view.h" |
| 23 #include "ui/app_list/views/custom_launcher_page_view.h" | 23 #include "ui/app_list/views/custom_launcher_page_view.h" |
| 24 #include "ui/app_list/views/search_box_view.h" | 24 #include "ui/app_list/views/search_box_view.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 void SetSelected(bool selected) { | 88 void SetSelected(bool selected) { |
| 89 selected_ = selected; | 89 selected_ = selected; |
| 90 SetVisible(selected); | 90 SetVisible(selected); |
| 91 if (selected) | 91 if (selected) |
| 92 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); | 92 NotifyAccessibilityEvent(ui::AX_EVENT_SELECTION, true); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool selected() { return selected_; } | 95 bool selected() { return selected_; } |
| 96 | 96 |
| 97 // Overridden from views::View: | 97 // Overridden from views::View: |
| 98 void GetAccessibleState(ui::AXViewState* state) override { | 98 void GetAccessibleNodeData(ui::AXNodeData* node_data) override { |
| 99 state->role = ui::AX_ROLE_BUTTON; | 99 node_data->role = ui::AX_ROLE_BUTTON; |
| 100 state->name = base::UTF8ToUTF16(custom_launcher_page_name_); | 100 node_data->SetName(custom_launcher_page_name_); |
| 101 } | 101 } |
| 102 | 102 |
| 103 private: | 103 private: |
| 104 bool selected_; | 104 bool selected_; |
| 105 std::string custom_launcher_page_name_; | 105 std::string custom_launcher_page_name_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(CustomLauncherPageBackgroundView); | 107 DISALLOW_COPY_AND_ASSIGN(CustomLauncherPageBackgroundView); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 // A container that holds the start page recommendation tiles and the all apps | 110 // A container that holds the start page recommendation tiles and the all apps |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 // is enabled). | 527 // is enabled). |
| 528 if (event->type() == ui::ET_SCROLL && event->y_offset() < 0) | 528 if (event->type() == ui::ET_SCROLL && event->y_offset() < 0) |
| 529 MaybeOpenCustomLauncherPage(); | 529 MaybeOpenCustomLauncherPage(); |
| 530 } | 530 } |
| 531 | 531 |
| 532 TileItemView* StartPageView::GetTileItemView(size_t index) { | 532 TileItemView* StartPageView::GetTileItemView(size_t index) { |
| 533 return tiles_container_->GetTileItemView(index); | 533 return tiles_container_->GetTileItemView(index); |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace app_list | 536 } // namespace app_list |
| OLD | NEW |