| 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/accelerators/accelerator_controller_delegate_aura.h" | 7 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 8 #include "ash/common/system/chromeos/palette/palette_utils.h" | 8 #include "ash/common/system/chromeos/palette/palette_utils.h" |
| 9 #include "ash/magnifier/partial_magnification_controller.h" | 9 #include "ash/magnifier/partial_magnification_controller.h" |
| 10 #include "ash/screenshot_delegate.h" | 10 #include "ash/screenshot_delegate.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/utility/screenshot_controller.h" | 12 #include "ash/utility/screenshot_controller.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/chromeos/note_taking_app_utils.h" | 14 #include "chrome/browser/chromeos/note_taking_helper.h" |
| 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 15 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
| 18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
| 19 #include "components/prefs/pref_change_registrar.h" | 19 #include "components/prefs/pref_change_registrar.h" |
| 20 #include "components/prefs/pref_service.h" | 20 #include "components/prefs/pref_service.h" |
| 21 #include "components/user_manager/user_manager.h" | 21 #include "components/user_manager/user_manager.h" |
| 22 #include "content/public/browser/notification_service.h" | 22 #include "content/public/browser/notification_service.h" |
| 23 #include "content/public/browser/notification_source.h" | 23 #include "content/public/browser/notification_source.h" |
| 24 #include "ui/events/devices/input_device_manager.h" | 24 #include "ui/events/devices/input_device_manager.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 50 const EnableListener& on_state_changed) { | 50 const EnableListener& on_state_changed) { |
| 51 auto subscription = palette_enabled_callback_list_.Add(on_state_changed); | 51 auto subscription = palette_enabled_callback_list_.Add(on_state_changed); |
| 52 OnPaletteEnabledPrefChanged(); | 52 OnPaletteEnabledPrefChanged(); |
| 53 return subscription; | 53 return subscription; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void PaletteDelegateChromeOS::CreateNote() { | 56 void PaletteDelegateChromeOS::CreateNote() { |
| 57 if (!profile_) | 57 if (!profile_) |
| 58 return; | 58 return; |
| 59 | 59 |
| 60 chromeos::LaunchNoteTakingAppForNewNote(profile_, base::FilePath()); | 60 chromeos::NoteTakingHelper::Get()->LaunchAppForNewNote(profile_, |
| 61 base::FilePath()); |
| 61 } | 62 } |
| 62 | 63 |
| 63 bool PaletteDelegateChromeOS::HasNoteApp() { | 64 bool PaletteDelegateChromeOS::HasNoteApp() { |
| 64 if (!profile_) | 65 if (!profile_) |
| 65 return false; | 66 return false; |
| 66 | 67 |
| 67 return chromeos::IsNoteTakingAppAvailable(profile_); | 68 return chromeos::NoteTakingHelper::Get()->IsAppAvailable(profile_); |
| 68 } | 69 } |
| 69 | 70 |
| 70 void PaletteDelegateChromeOS::ActiveUserChanged(const AccountId& account_id) { | 71 void PaletteDelegateChromeOS::ActiveUserChanged(const AccountId& account_id) { |
| 71 const user_manager::User* user = | 72 const user_manager::User* user = |
| 72 user_manager::UserManager::Get()->FindUser(account_id); | 73 user_manager::UserManager::Get()->FindUser(account_id); |
| 73 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); | 74 Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); |
| 74 SetProfile(profile); | 75 SetProfile(profile); |
| 75 } | 76 } |
| 76 | 77 |
| 77 void PaletteDelegateChromeOS::Observe( | 78 void PaletteDelegateChromeOS::Observe( |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 179 } |
| 179 | 180 |
| 180 void PaletteDelegateChromeOS::CancelPartialScreenshot() { | 181 void PaletteDelegateChromeOS::CancelPartialScreenshot() { |
| 181 ash::Shell::GetInstance()->screenshot_controller()->CancelScreenshotSession(); | 182 ash::Shell::GetInstance()->screenshot_controller()->CancelScreenshotSession(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 void PaletteDelegateChromeOS::OnStylusStateChanged(ui::StylusState state) { | 185 void PaletteDelegateChromeOS::OnStylusStateChanged(ui::StylusState state) { |
| 185 on_stylus_state_changed_.Run(state); | 186 on_stylus_state_changed_.Run(state); |
| 186 } | 187 } |
| 187 } // namespace chromeos | 188 } // namespace chromeos |
| OLD | NEW |