WebApp: Add GURL scope and theme_color WebApp data members.
We parse them from manifest during installability check.
Bug: 891172
Change-Id: I891dd48f29e6f43386c028a14f92c08db630da5e
Reviewed-on: https://chromium-review.googlesource.com/c/1325580
Commit-Queue: Alexey Baskakov <[email protected]>
Reviewed-by: Alan Cutter <[email protected]>
Cr-Commit-Position: refs/heads/master@{#606395}
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc
index 0b94cdd..3412bf4 100644
--- a/chrome/browser/web_applications/web_app.cc
+++ b/chrome/browser/web_applications/web_app.cc
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <ios>
#include <ostream>
#include "base/logging.h"
#include "chrome/browser/web_applications/web_app.h"
+#include "ui/gfx/color_utils.h"
namespace web_app {
@@ -26,10 +28,26 @@
launch_url_ = launch_url;
}
+void WebApp::SetScope(const GURL& scope) {
+ DCHECK(scope.is_empty() || scope.is_valid());
+ scope_ = scope;
+}
+
+void WebApp::SetThemeColor(base::Optional<SkColor> theme_color) {
+ theme_color_ = theme_color;
+}
+
std::ostream& operator<<(std::ostream& out, const WebApp& app) {
+ const std::string theme_color =
+ app.theme_color()
+ ? color_utils::SkColorToRgbaString(app.theme_color().value())
+ : "none";
+
return out << "app_id: " << app.app_id() << std::endl
<< " name: " << app.name() << std::endl
<< " launch_url: " << app.launch_url() << std::endl
+ << " scope: " << app.scope() << std::endl
+ << " theme_color: " << theme_color << std::endl
<< " description: " << app.description();
}