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 #ifndef CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 launch_chrome_app_callback_ = callback; | 151 launch_chrome_app_callback_ = callback; |
152 } | 152 } |
153 | 153 |
154 // Adds or removes an observer. | 154 // Adds or removes an observer. |
155 void AddObserver(Observer* observer); | 155 void AddObserver(Observer* observer); |
156 void RemoveObserver(Observer* observer); | 156 void RemoveObserver(Observer* observer); |
157 | 157 |
158 // Returns a list of available note-taking apps. | 158 // Returns a list of available note-taking apps. |
159 std::vector<NoteTakingAppInfo> GetAvailableApps(Profile* profile); | 159 std::vector<NoteTakingAppInfo> GetAvailableApps(Profile* profile); |
160 | 160 |
| 161 // Returns the preferred app info, if the preferred app exists and is a Chrome |
| 162 // app. |
| 163 std::unique_ptr<NoteTakingAppInfo> GetPreferredChromeAppInfo( |
| 164 Profile* profile); |
| 165 |
161 // Sets the preferred note-taking app. |app_id| is a value from a | 166 // Sets the preferred note-taking app. |app_id| is a value from a |
162 // NoteTakingAppInfo object. | 167 // NoteTakingAppInfo object. |
163 void SetPreferredApp(Profile* profile, const std::string& app_id); | 168 void SetPreferredApp(Profile* profile, const std::string& app_id); |
164 | 169 |
165 // Returns true if an app that can be used to take notes is available. UI | 170 // Returns true if an app that can be used to take notes is available. UI |
166 // surfaces that call LaunchAppForNewNote() should be hidden otherwise. | 171 // surfaces that call LaunchAppForNewNote() should be hidden otherwise. |
167 bool IsAppAvailable(Profile* profile); | 172 bool IsAppAvailable(Profile* profile); |
168 | 173 |
169 // Launches the note-taking app to create a new note, optionally additionally | 174 // Launches the note-taking app to create a new note, optionally additionally |
170 // passing a file (|path| may be empty). IsAppAvailable() must be called | 175 // passing a file (|path| may be empty). IsAppAvailable() must be called |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 content::NotificationRegistrar registrar_; | 255 content::NotificationRegistrar registrar_; |
251 | 256 |
252 base::WeakPtrFactory<NoteTakingHelper> weak_ptr_factory_; | 257 base::WeakPtrFactory<NoteTakingHelper> weak_ptr_factory_; |
253 | 258 |
254 DISALLOW_COPY_AND_ASSIGN(NoteTakingHelper); | 259 DISALLOW_COPY_AND_ASSIGN(NoteTakingHelper); |
255 }; | 260 }; |
256 | 261 |
257 } // namespace chromeos | 262 } // namespace chromeos |
258 | 263 |
259 #endif // CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ | 264 #endif // CHROME_BROWSER_CHROMEOS_NOTE_TAKING_HELPER_H_ |
OLD | NEW |