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& p) { | |
James Cook
2016/09/01 23:16:02
nit: p -> point or similar
jdufault
2016/09/02 20:20:38
Using p cleaned up some of the formatting to avoid
| |
224 return (icon_ && icon_->GetBoundsInScreen().Contains(p.x(), p.y())) || | |
James Cook
2016/09/01 23:16:02
nit: This might be more readable as multiple early
jdufault
2016/09/02 20:20:38
Also something I was toying with. Done.
| |
225 (bubble_ && | |
226 bubble_->bubble_view()->GetBoundsInScreen().Contains(p.x(), p.y())); | |
227 } | |
228 | |
223 void PaletteTray::AddToolsToView(views::View* host) { | 229 void PaletteTray::AddToolsToView(views::View* host) { |
224 std::vector<PaletteToolView> views = palette_tool_manager_->CreateViews(); | 230 std::vector<PaletteToolView> views = palette_tool_manager_->CreateViews(); |
225 for (const PaletteToolView& view : views) | 231 for (const PaletteToolView& view : views) |
226 host->AddChildView(view.view); | 232 host->AddChildView(view.view); |
227 } | 233 } |
228 | 234 |
229 void PaletteTray::SessionStateChanged( | 235 void PaletteTray::SessionStateChanged( |
230 SessionStateDelegate::SessionState state) { | 236 SessionStateDelegate::SessionState state) { |
231 UpdateIconVisibility(); | 237 UpdateIconVisibility(); |
232 } | 238 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 WmShell::Get()->GetSessionStateDelegate(); | 377 WmShell::Get()->GetSessionStateDelegate(); |
372 | 378 |
373 SetVisible(!session_state_delegate->IsScreenLocked() && | 379 SetVisible(!session_state_delegate->IsScreenLocked() && |
374 session_state_delegate->GetSessionState() == | 380 session_state_delegate->GetSessionState() == |
375 SessionStateDelegate::SESSION_STATE_ACTIVE && | 381 SessionStateDelegate::SESSION_STATE_ACTIVE && |
376 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != | 382 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != |
377 LoginStatus::KIOSK_APP); | 383 LoginStatus::KIOSK_APP); |
378 } | 384 } |
379 | 385 |
380 } // namespace ash | 386 } // namespace ash |
OLD | NEW |