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

Unified Diff: chrome/common/extensions/manifest_handlers/app_icon_color_info.h

Issue 782693002: Ensure there are always nice icons for bookmark apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac compile Created 6 years 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 side-by-side diff with in-line comments
Download patch
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..e44e301ab52764c05019fc9e229204a9030bc5ba
--- /dev/null
+++ b/chrome/common/extensions/manifest_handlers/app_icon_color_info.h
@@ -0,0 +1,49 @@
+// 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 {
+ 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_

Powered by Google App Engine
This is Rietveld 408576698