| Index: chrome/browser/ui/views/apps/jumplist_updater_win.h
|
| diff --git a/chrome/browser/ui/views/apps/jumplist_updater_win.h b/chrome/browser/ui/views/apps/jumplist_updater_win.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dce66587d872910ba5c543ee2faa48653656cde8
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/views/apps/jumplist_updater_win.h
|
| @@ -0,0 +1,71 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_
|
| +#define CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/files/file_path.h"
|
| +#include "base/strings/string16.h"
|
| +#include "ui/gfx/image/image.h"
|
| +
|
| +class Profile;
|
| +
|
| +// Updates the jump list of an application. Jump lists are available in
|
| +// Windows 7 and later only.
|
| +// Note that all list items are added to the predefined "Tasks" category.
|
| +// Support for other categories or custom categories will be added when
|
| +// required.
|
| +class JumpListUpdater {
|
| + public:
|
| + // A single item in the jump list. "chrome.exe" will be invoked for each
|
| + // list item. Each item can specify additional command line switches.
|
| + struct ListItem {
|
| + // List item caption.
|
| + base::string16 title;
|
| +
|
| + // The path of the list item's icon.
|
| + base::FilePath icon_path;
|
| +
|
| + // Command line args for the list item.
|
| + base::string16 command_line_args;
|
| +
|
| + ListItem(const base::string16& title,
|
| + const base::FilePath& icon_path,
|
| + const base::string16& args)
|
| + : title(title), icon_path(icon_path), command_line_args(args) {}
|
| +
|
| + ListItem(const base::string16& title, const base::FilePath& icon_path)
|
| + : title(title), icon_path(icon_path) {}
|
| + };
|
| +
|
| + // Append a switch and value to command line args.
|
| + static void AppendArgs(const std::string& switch_string,
|
| + const base::string16& value,
|
| + base::string16* command_line_args);
|
| +
|
| + JumpListUpdater(Profile* profile,
|
| + const base::string16& app_user_model_id);
|
| + virtual ~JumpListUpdater();
|
| +
|
| + // Update the jump list.
|
| + void Update(const std::vector<ListItem>& items);
|
| +
|
| + private:
|
| + Profile* profile_;
|
| +
|
| + // The Windows AppUserModelID.
|
| + base::string16 app_user_model_id_;
|
| +
|
| + // Absolute path to chrome.exe.
|
| + base::FilePath chrome_path_;
|
| +
|
| + // Common command line switches for each list item.
|
| + base::string16 default_chrome_switches_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(JumpListUpdater);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_UI_VIEWS_APPS_JUMPLIST_UPDATER_WIN_H_
|
|
|