| 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/chromeos/note_taking_app_utils.h" | 5 #include "chrome/browser/chromeos/note_taking_app_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/launcher.h" | 10 #include "apps/launcher.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 id, extensions::ExtensionRegistry::ENABLED); | 62 id, extensions::ExtensionRegistry::ENABLED); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 return nullptr; | 65 return nullptr; |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 bool IsNoteTakingAppAvailable(Profile* profile) { | 70 bool IsNoteTakingAppAvailable(Profile* profile) { |
| 71 DCHECK(profile); | 71 DCHECK(profile); |
| 72 return ash::IsPaletteEnabled() && GetApp(profile); | 72 return ash::IsPaletteFeatureEnabled() && GetApp(profile); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void LaunchNoteTakingAppForNewNote(Profile* profile, | 75 void LaunchNoteTakingAppForNewNote(Profile* profile, |
| 76 const base::FilePath& path) { | 76 const base::FilePath& path) { |
| 77 DCHECK(profile); | 77 DCHECK(profile); |
| 78 const extensions::Extension* app = GetApp(profile); | 78 const extensions::Extension* app = GetApp(profile); |
| 79 if (!app) { | 79 if (!app) { |
| 80 LOG(ERROR) << "Failed to find note-taking app"; | 80 LOG(ERROR) << "Failed to find note-taking app"; |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 auto action_data = base::MakeUnique<app_runtime::ActionData>(); | 84 auto action_data = base::MakeUnique<app_runtime::ActionData>(); |
| 85 action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; | 85 action_data->action_type = app_runtime::ActionType::ACTION_TYPE_NEW_NOTE; |
| 86 apps::LaunchPlatformAppWithAction(profile, app, std::move(action_data), path); | 86 apps::LaunchPlatformAppWithAction(profile, app, std::move(action_data), path); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace chromeos | 89 } // namespace chromeos |
| OLD | NEW |