Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Side by Side Diff: chrome/browser/web_applications/web_app.h

Issue 14993013: Windows: When an app is updated and its name changes, recreate shortcuts. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Respond to reviewer feedback. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_WEB_APPLICATIONS_WEB_APP_H_ 5 #ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_
6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ 6 #define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/string16.h"
12 #include "build/build_config.h" 13 #include "build/build_config.h"
13 #include "chrome/browser/shell_integration.h" 14 #include "chrome/browser/shell_integration.h"
14 #include "chrome/common/web_application_info.h" 15 #include "chrome/common/web_application_info.h"
15 16
16 namespace extensions { 17 namespace extensions {
17 class Extension; 18 class Extension;
18 } 19 }
19 20
20 namespace gfx { 21 namespace gfx {
21 class ImageFamily; 22 class ImageFamily;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void CreateShortcuts( 57 void CreateShortcuts(
57 const ShellIntegration::ShortcutInfo& shortcut_info, 58 const ShellIntegration::ShortcutInfo& shortcut_info,
58 const ShellIntegration::ShortcutLocations& creation_locations); 59 const ShellIntegration::ShortcutLocations& creation_locations);
59 60
60 // Delete all the shortcuts that have been created for the given 61 // Delete all the shortcuts that have been created for the given
61 // |shortcut_data| in the profile with |profile_path|. 62 // |shortcut_data| in the profile with |profile_path|.
62 void DeleteAllShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info); 63 void DeleteAllShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info);
63 64
64 // Updates shortcuts for web application based on given shortcut data. This 65 // Updates shortcuts for web application based on given shortcut data. This
65 // refreshes existing shortcuts and their icons, but does not create new ones. 66 // refreshes existing shortcuts and their icons, but does not create new ones.
67 // |old_app_title| contains the title of the app prior to this update.
66 // |shortcut_info| contains information about the shortcuts to update. 68 // |shortcut_info| contains information about the shortcuts to update.
67 void UpdateAllShortcuts(const ShellIntegration::ShortcutInfo& shortcut_info); 69 void UpdateAllShortcuts(const string16& old_app_title,
70 const ShellIntegration::ShortcutInfo& shortcut_info);
68 71
69 // Creates a shortcut. Must be called on the file thread. This is used to 72 // Creates a shortcut. Must be called on the file thread. This is used to
70 // implement CreateShortcuts() above, and can also be used directly from the 73 // implement CreateShortcuts() above, and can also be used directly from the
71 // file thread. |shortcut_info| contains info about the shortcut to create, and 74 // file thread. |shortcut_info| contains info about the shortcut to create, and
72 // |creation_locations| contains information about where to create them. 75 // |creation_locations| contains information about where to create them.
73 bool CreateShortcutsOnFileThread( 76 bool CreateShortcutsOnFileThread(
74 const ShellIntegration::ShortcutInfo& shortcut_info, 77 const ShellIntegration::ShortcutInfo& shortcut_info,
75 const ShellIntegration::ShortcutLocations& creation_locations); 78 const ShellIntegration::ShortcutLocations& creation_locations);
76 79
77 // Returns true if given url is a valid web app url. 80 // Returns true if given url is a valid web app url.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // is executed on the FILE thread. 124 // is executed on the FILE thread.
122 void DeletePlatformShortcuts( 125 void DeletePlatformShortcuts(
123 const base::FilePath& shortcut_data_path, 126 const base::FilePath& shortcut_data_path,
124 const ShellIntegration::ShortcutInfo& shortcut_info); 127 const ShellIntegration::ShortcutInfo& shortcut_info);
125 128
126 // Updates all the shortcuts we have added for this extension. This is the 129 // Updates all the shortcuts we have added for this extension. This is the
127 // platform specific implementation of the UpdateAllShortcuts function, and 130 // platform specific implementation of the UpdateAllShortcuts function, and
128 // is executed on the FILE thread. 131 // is executed on the FILE thread.
129 void UpdatePlatformShortcuts( 132 void UpdatePlatformShortcuts(
130 const base::FilePath& shortcut_data_path, 133 const base::FilePath& shortcut_data_path,
134 const string16& old_app_title,
131 const ShellIntegration::ShortcutInfo& shortcut_info); 135 const ShellIntegration::ShortcutInfo& shortcut_info);
132 136
133 // Sanitizes |name| and returns a version of it that is safe to use as an 137 // Sanitizes |name| and returns a version of it that is safe to use as an
134 // on-disk file name . 138 // on-disk file name .
135 base::FilePath GetSanitizedFileName(const string16& name); 139 base::FilePath GetSanitizedFileName(const string16& name);
136 140
137 } // namespace internals 141 } // namespace internals
138 142
139 } // namespace web_app 143 } // namespace web_app
140 144
141 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_ 145 #endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service_unittest.cc ('k') | chrome/browser/web_applications/web_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698