| 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 "chrome/browser/ui/ash/palette_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/palette_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" |
| 7 #include "chrome/browser/chromeos/note_taking_app_utils.h" | 8 #include "chrome/browser/chromeos/note_taking_app_utils.h" |
| 8 #include "chrome/browser/profiles/profile_manager.h" | 9 #include "chrome/browser/profiles/profile_manager.h" |
| 9 | 10 |
| 10 namespace chromeos { | 11 namespace chromeos { |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 Profile* GetProfile() { | 14 Profile* GetProfile() { |
| 14 return ProfileManager::GetActiveUserProfile(); | 15 return ProfileManager::GetActiveUserProfile(); |
| 15 } | 16 } |
| 16 | 17 |
| 17 } // namespace | 18 } // namespace |
| 18 | 19 |
| 19 PaletteDelegateChromeOS::PaletteDelegateChromeOS() {} | 20 PaletteDelegateChromeOS::PaletteDelegateChromeOS() {} |
| 20 | 21 |
| 21 PaletteDelegateChromeOS::~PaletteDelegateChromeOS() {} | 22 PaletteDelegateChromeOS::~PaletteDelegateChromeOS() {} |
| 22 | 23 |
| 23 void PaletteDelegateChromeOS::CreateNote() { | 24 void PaletteDelegateChromeOS::CreateNote() { |
| 24 chromeos::LaunchNoteTakingAppForNewNote(GetProfile(), base::FilePath()); | 25 chromeos::LaunchNoteTakingAppForNewNote(GetProfile(), base::FilePath()); |
| 25 } | 26 } |
| 26 | 27 |
| 27 bool PaletteDelegateChromeOS::HasNoteApp() { | 28 bool PaletteDelegateChromeOS::HasNoteApp() { |
| 28 return chromeos::IsNoteTakingAppAvailable(GetProfile()); | 29 return chromeos::IsNoteTakingAppAvailable(GetProfile()); |
| 29 } | 30 } |
| 30 | 31 |
| 32 void PaletteDelegateChromeOS::OnLaserPointerEnabled() { |
| 33 // We lock the cursor after we hide it because compound_event_filter.cc will |
| 34 // attempt to call ShowCursor every time it recieves a mouse event. |
| 35 ash::Shell::GetInstance()->cursor_manager()->HideCursor(); |
| 36 ash::Shell::GetInstance()->cursor_manager()->LockCursor(); |
| 37 } |
| 38 |
| 39 void PaletteDelegateChromeOS::OnLaserPointerDisabled() { |
| 40 ash::Shell::GetInstance()->cursor_manager()->UnlockCursor(); |
| 41 ash::Shell::GetInstance()->cursor_manager()->ShowCursor(); |
| 42 } |
| 31 } // namespace chromeos | 43 } // namespace chromeos |
| OLD | NEW |