| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 id, extensions::ExtensionRegistry::ENABLED); | 56 id, extensions::ExtensionRegistry::ENABLED); |
| 57 } | 57 } |
| 58 } | 58 } |
| 59 return nullptr; | 59 return nullptr; |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 bool IsNoteTakingAppAvailable(Profile* profile) { | 64 bool IsNoteTakingAppAvailable(Profile* profile) { |
| 65 DCHECK(profile); | 65 DCHECK(profile); |
| 66 return ash::IsPaletteEnabled() && GetApp(profile); | 66 return ash::IsPaletteFeatureEnabled() && GetApp(profile); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void LaunchNoteTakingAppForNewNote(Profile* profile, | 69 void LaunchNoteTakingAppForNewNote(Profile* profile, |
| 70 const base::FilePath& path) { | 70 const base::FilePath& path) { |
| 71 DCHECK(profile); | 71 DCHECK(profile); |
| 72 const extensions::Extension* app = GetApp(profile); | 72 const extensions::Extension* app = GetApp(profile); |
| 73 if (!app) { | 73 if (!app) { |
| 74 LOG(ERROR) << "Failed to find note-taking app"; | 74 LOG(ERROR) << "Failed to find note-taking app"; |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 // TODO(derat): Launch with a "create new note" launch action once that's been | 78 // TODO(derat): Launch with a "create new note" launch action once that's been |
| 79 // added to chrome.appRuntime. Also decide what should be passed as the launch | 79 // added to chrome.appRuntime. Also decide what should be passed as the launch |
| 80 // source. | 80 // source. |
| 81 if (path.empty()) | 81 if (path.empty()) |
| 82 apps::LaunchPlatformApp(profile, app, extensions::SOURCE_UNTRACKED); | 82 apps::LaunchPlatformApp(profile, app, extensions::SOURCE_UNTRACKED); |
| 83 else | 83 else |
| 84 apps::LaunchPlatformAppWithPath(profile, app, path); | 84 apps::LaunchPlatformAppWithPath(profile, app, path); |
| 85 } | 85 } |
| 86 | 86 |
| 87 } // namespace chromeos | 87 } // namespace chromeos |
| OLD | NEW |