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 "ash/shelf/app_list_button.h" | 5 #include "ash/shelf/app_list_button.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/public/cpp/shelf_types.h" | 10 #include "ash/public/cpp/shelf_types.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 wm_shelf_(wm_shelf) { | 50 wm_shelf_(wm_shelf) { |
51 DCHECK(listener_); | 51 DCHECK(listener_); |
52 DCHECK(shelf_view_); | 52 DCHECK(shelf_view_); |
53 DCHECK(wm_shelf_); | 53 DCHECK(wm_shelf_); |
54 | 54 |
55 SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); | 55 SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); |
56 set_ink_drop_base_color(kShelfInkDropBaseColor); | 56 set_ink_drop_base_color(kShelfInkDropBaseColor); |
57 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity); | 57 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity); |
58 SetAccessibleName( | 58 SetAccessibleName( |
59 l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE)); | 59 l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE)); |
60 SetSize( | 60 SetSize(gfx::Size(kShelfSize, kShelfSize)); |
61 gfx::Size(GetShelfConstant(SHELF_SIZE), GetShelfConstant(SHELF_SIZE))); | |
62 SetFocusPainter(TrayPopupUtils::CreateFocusPainter()); | 61 SetFocusPainter(TrayPopupUtils::CreateFocusPainter()); |
63 set_notify_action(CustomButton::NOTIFY_ON_PRESS); | 62 set_notify_action(CustomButton::NOTIFY_ON_PRESS); |
64 } | 63 } |
65 | 64 |
66 AppListButton::~AppListButton() {} | 65 AppListButton::~AppListButton() {} |
67 | 66 |
68 void AppListButton::OnAppListShown() { | 67 void AppListButton::OnAppListShown() { |
69 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); | 68 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); |
70 is_showing_app_list_ = true; | 69 is_showing_app_list_ = true; |
71 wm_shelf_->UpdateAutoHideState(); | 70 wm_shelf_->UpdateAutoHideState(); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 return gfx::Point(x_mid, x_mid); | 243 return gfx::Point(x_mid, x_mid); |
245 } else if (alignment == SHELF_ALIGNMENT_RIGHT) { | 244 } else if (alignment == SHELF_ALIGNMENT_RIGHT) { |
246 return gfx::Point(y_mid, y_mid); | 245 return gfx::Point(y_mid, y_mid); |
247 } else { | 246 } else { |
248 DCHECK_EQ(alignment, SHELF_ALIGNMENT_LEFT); | 247 DCHECK_EQ(alignment, SHELF_ALIGNMENT_LEFT); |
249 return gfx::Point(width() - y_mid, y_mid); | 248 return gfx::Point(width() - y_mid, y_mid); |
250 } | 249 } |
251 } | 250 } |
252 | 251 |
253 } // namespace ash | 252 } // namespace ash |
OLD | NEW |