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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 extensions::ActionData action_data; |
79 // added to chrome.appRuntime. Also decide what should be passed as the launch | 79 action_data.action_type = extensions::ActionType::NEW_NOTE; |
80 // source. | 80 apps::LaunchPlatformAppWithAction(profile, app, action_data, path); |
81 if (path.empty()) | |
82 apps::LaunchPlatformApp(profile, app, extensions::SOURCE_UNTRACKED); | |
83 else | |
84 apps::LaunchPlatformAppWithPath(profile, app, path); | |
85 } | 81 } |
86 | 82 |
87 } // namespace chromeos | 83 } // namespace chromeos |
OLD | NEW |