| 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_SHELL_INTEGRATION_WIN_H_ | 5 #ifndef CHROME_BROWSER_SHELL_INTEGRATION_WIN_H_ |
| 6 #define CHROME_BROWSER_SHELL_INTEGRATION_WIN_H_ | 6 #define CHROME_BROWSER_SHELL_INTEGRATION_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Note: If the app has an installation specific suffix (e.g. on user-level | 50 // Note: If the app has an installation specific suffix (e.g. on user-level |
| 51 // Chrome installs), |app_name| should already be suffixed, this method will | 51 // Chrome installs), |app_name| should already be suffixed, this method will |
| 52 // then further suffix it with the profile id as described above. | 52 // then further suffix it with the profile id as described above. |
| 53 base::string16 GetAppModelIdForProfile(const base::string16& app_name, | 53 base::string16 GetAppModelIdForProfile(const base::string16& app_name, |
| 54 const base::FilePath& profile_path); | 54 const base::FilePath& profile_path); |
| 55 | 55 |
| 56 // Generates an application user model ID (AppUserModelId) for Chromium by | 56 // Generates an application user model ID (AppUserModelId) for Chromium by |
| 57 // calling GetAppModelIdForProfile() with ShellUtil::GetAppId() as app_name. | 57 // calling GetAppModelIdForProfile() with ShellUtil::GetAppId() as app_name. |
| 58 base::string16 GetChromiumModelIdForProfile(const base::FilePath& profile_path); | 58 base::string16 GetChromiumModelIdForProfile(const base::FilePath& profile_path); |
| 59 | 59 |
| 60 // Records the pinned state of the current executable into a histogram. Must be | 60 // Returns the taskbar pin state of Chrome via the IsPinnedToTaskbarCallback. |
| 61 // called on the IO thread. | 61 // The first bool is true if the state could be calculated, and the second bool |
| 62 void RecordIsPinnedToTaskbarHistogram(); | 62 // is true if Chrome is pinned to the taskbar. |
| 63 // The ConnectionErrorCallback is called instead if something wrong happened |
| 64 // with the connection to the remote process. |
| 65 using ConnectionErrorCallback = base::Closure; |
| 66 using IsPinnedToTaskbarCallback = base::Callback<void(bool, bool)>; |
| 67 void GetIsPinnedToTaskbarState( |
| 68 const ConnectionErrorCallback& on_error_callback, |
| 69 const IsPinnedToTaskbarCallback& result_callback); |
| 63 | 70 |
| 64 // Migrates existing chrome taskbar pins by tagging them with correct app id. | 71 // Migrates existing chrome taskbar pins by tagging them with correct app id. |
| 65 // see http://crbug.com/28104 | 72 // see http://crbug.com/28104 |
| 66 void MigrateTaskbarPins(); | 73 void MigrateTaskbarPins(); |
| 67 | 74 |
| 68 // Migrates all shortcuts in |path| which point to |chrome_exe| such that they | 75 // Migrates all shortcuts in |path| which point to |chrome_exe| such that they |
| 69 // have the appropriate AppUserModelId. Also clears the legacy dual_mode | 76 // have the appropriate AppUserModelId. Also clears the legacy dual_mode |
| 70 // property from shortcuts with the default chrome app id. | 77 // property from shortcuts with the default chrome app id. |
| 71 // Returns the number of shortcuts migrated. | 78 // Returns the number of shortcuts migrated. |
| 72 // This method should not be called prior to Windows 7. | 79 // This method should not be called prior to Windows 7. |
| 73 // This method is only public for the sake of tests and shouldn't be called | 80 // This method is only public for the sake of tests and shouldn't be called |
| 74 // externally otherwise. | 81 // externally otherwise. |
| 75 int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe, | 82 int MigrateShortcutsInPathInternal(const base::FilePath& chrome_exe, |
| 76 const base::FilePath& path); | 83 const base::FilePath& path); |
| 77 | 84 |
| 78 // Returns the path to the Start Menu shortcut for the given Chrome. | 85 // Returns the path to the Start Menu shortcut for the given Chrome. |
| 79 base::FilePath GetStartMenuShortcut(const base::FilePath& chrome_exe); | 86 base::FilePath GetStartMenuShortcut(const base::FilePath& chrome_exe); |
| 80 | 87 |
| 81 } // namespace win | 88 } // namespace win |
| 82 } // namespace shell_integration | 89 } // namespace shell_integration |
| 83 | 90 |
| 84 #endif // CHROME_BROWSER_SHELL_INTEGRATION_WIN_H_ | 91 #endif // CHROME_BROWSER_SHELL_INTEGRATION_WIN_H_ |
| OLD | NEW |