OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/files/file_path.h" | |
11 #include "base/strings/string16.h" | |
12 #include "ui/gfx/image/image.h" | |
tapted
2014/02/12 10:16:28
nit: don't think this is used
| |
13 | |
14 class Profile; | |
15 | |
16 // Updates the jump list of an application. Jump lists are available in | |
17 // Windows 7 and later only. | |
18 // Note that all list items are added to the predefined "Tasks" category. | |
19 // Support for other categories or custom categories will be added when | |
20 // required. | |
21 class JumpListUpdater { | |
22 public: | |
23 // A single item in the jump list. "chrome.exe" will be invoked for each | |
24 // list item. Each item can specify additional command line switches. | |
25 struct ListItem { | |
26 // List item caption. | |
27 base::string16 title; | |
28 | |
29 // The path of the list item's icon. | |
30 base::FilePath icon_path; | |
31 | |
32 // Command line args for the list item. | |
33 base::string16 command_line_args; | |
34 | |
35 ListItem(const base::string16& title, | |
36 const base::FilePath& icon_path, | |
37 const base::string16& args) | |
38 : title(title), icon_path(icon_path), command_line_args(args) {} | |
tapted
2014/02/12 10:16:28
I don't think anything's calling this constructor.
| |
39 | |
40 ListItem(const base::string16& title, const base::FilePath& icon_path) | |
tapted
2014/02/12 10:16:28
nit: non-trivial constructors shouldn't be defined
| |
41 : title(title), icon_path(icon_path) {} | |
42 }; | |
43 | |
44 // Append a switch and value to command line args. | |
tapted
2014/02/12 10:16:28
This feels a bit out of place here (e.g. it's not
| |
45 static void AppendArgs(const std::string& switch_string, | |
46 const base::string16& value, | |
47 base::string16* command_line_args); | |
48 | |
49 JumpListUpdater(Profile* profile, | |
50 const base::string16& app_user_model_id); | |
51 virtual ~JumpListUpdater(); | |
52 | |
53 // Update the jump list. | |
54 void Update(const std::vector<ListItem>& items); | |
tapted
2014/02/12 10:16:28
Actually, partway through the review, I just found
| |
55 | |
56 private: | |
57 Profile* profile_; | |
58 | |
59 // The Windows AppUserModelID. | |
60 base::string16 app_user_model_id_; | |
61 | |
62 // Absolute path to chrome.exe. | |
63 base::FilePath chrome_path_; | |
64 | |
65 // Common command line switches for each list item. | |
66 base::string16 default_chrome_switches_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(JumpListUpdater); | |
69 }; | |
70 | |
71 #endif // CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_ | |
OLD | NEW |