Chromium Code Reviews| Index: chrome/common/extensions/manifest_handlers/app_icon_color_info.h |
| diff --git a/chrome/common/extensions/manifest_handlers/app_icon_color_info.h b/chrome/common/extensions/manifest_handlers/app_icon_color_info.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7263f6524181cd131669f87e9c98f16d5821f106 |
| --- /dev/null |
| +++ b/chrome/common/extensions/manifest_handlers/app_icon_color_info.h |
| @@ -0,0 +1,50 @@ |
| +// 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_COMMON_EXTENSIONS_MANIFEST_HANDLERS_APP_ICON_COLOR_INFO_H_ |
| +#define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_APP_ICON_COLOR_INFO_H_ |
| + |
| +#include "extensions/common/extension.h" |
| +#include "extensions/common/manifest_handler.h" |
| +#include "third_party/skia/include/core/SkColor.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +namespace extensions { |
| + |
| +// A structure to hold the parsed app icon color data. |
| +struct AppIconColorInfo : public Extension::ManifestData { |
| + // Define out of line constructor/destructor to please Clang. |
|
calamity
2014/12/09 03:46:12
I don't think this comment is necessary.
benwells
2014/12/09 08:28:35
Done.
|
| + AppIconColorInfo(); |
| + ~AppIconColorInfo() override; |
| + |
| + static SkColor GetIconColor(const Extension* extension); |
| + static const std::string& GetIconColorString(const Extension* extension); |
| + |
| + // The color to use if icons need to be generated for the app. |
| + SkColor icon_color_; |
| + |
| + // The string representation of the icon color. |
| + std::string icon_color_string_; |
| +}; |
| + |
| +// Parses the "app.icon_color" manifest key. |
| +class AppIconColorHandler : public ManifestHandler { |
| + public: |
| + AppIconColorHandler(); |
| + ~AppIconColorHandler() override; |
| + |
| + bool Parse(Extension* extension, base::string16* error) override; |
| + |
| + private: |
| + const std::vector<std::string> Keys() const override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AppIconColorHandler); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_APP_ICON_COLOR_INFO_H_ |