OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/system/chromeos/palette/palette_tray.h" | 5 #include "ash/common/system/chromeos/palette/palette_tray.h" |
6 | 6 |
7 #include "ash/common/shelf/shelf_constants.h" | 7 #include "ash/common/shelf/shelf_constants.h" |
8 #include "ash/common/shelf/wm_shelf.h" | 8 #include "ash/common/shelf/wm_shelf.h" |
9 #include "ash/common/shelf/wm_shelf_util.h" | 9 #include "ash/common/shelf/wm_shelf_util.h" |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
213 bubble_view->AddChildView(separator); | 213 bubble_view->AddChildView(separator); |
214 AddToolsToView(bubble_view); | 214 AddToolsToView(bubble_view); |
215 | 215 |
216 // Show the bubble. | 216 // Show the bubble. |
217 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); | 217 bubble_.reset(new ash::TrayBubbleWrapper(this, bubble_view)); |
218 | 218 |
219 SetDrawBackgroundAsActive(true); | 219 SetDrawBackgroundAsActive(true); |
220 return true; | 220 return true; |
221 } | 221 } |
222 | 222 |
223 bool PaletteTray::ContainsPointInScreen(const gfx::Point& point) { | |
224 if (icon_ && icon_->GetBoundsInScreen().Contains(point.x(), point.y())) | |
James Cook
2016/09/06 16:16:31
nit: You can just do Contains(point). Sorry I didn
jdufault
2016/09/07 22:39:06
Done; I was looking for that override but somehow
| |
225 return true; | |
226 | |
227 return bubble_ && | |
228 bubble_->bubble_view()->GetBoundsInScreen().Contains(point.x(), | |
229 point.y()); | |
230 } | |
231 | |
223 void PaletteTray::AddToolsToView(views::View* host) { | 232 void PaletteTray::AddToolsToView(views::View* host) { |
224 std::vector<PaletteToolView> views = palette_tool_manager_->CreateViews(); | 233 std::vector<PaletteToolView> views = palette_tool_manager_->CreateViews(); |
225 for (const PaletteToolView& view : views) | 234 for (const PaletteToolView& view : views) |
226 host->AddChildView(view.view); | 235 host->AddChildView(view.view); |
227 } | 236 } |
228 | 237 |
229 void PaletteTray::SessionStateChanged( | 238 void PaletteTray::SessionStateChanged( |
230 SessionStateDelegate::SessionState state) { | 239 SessionStateDelegate::SessionState state) { |
231 UpdateIconVisibility(); | 240 UpdateIconVisibility(); |
232 } | 241 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 WmShell::Get()->GetSessionStateDelegate(); | 380 WmShell::Get()->GetSessionStateDelegate(); |
372 | 381 |
373 SetVisible(!session_state_delegate->IsScreenLocked() && | 382 SetVisible(!session_state_delegate->IsScreenLocked() && |
374 session_state_delegate->GetSessionState() == | 383 session_state_delegate->GetSessionState() == |
375 SessionStateDelegate::SESSION_STATE_ACTIVE && | 384 SessionStateDelegate::SESSION_STATE_ACTIVE && |
376 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 385 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
377 LoginStatus::KIOSK_APP); | 386 LoginStatus::KIOSK_APP); |
378 } | 387 } |
379 | 388 |
380 } // namespace ash | 389 } // namespace ash |
OLD | NEW |