summaryrefslogtreecommitdiff
path: root/chromium/ui/message_center/public
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-07-31 15:50:41 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:35:23 +0000
commit7b2ffa587235a47d4094787d72f38102089f402a (patch)
tree30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/ui/message_center/public
parentd94af01c90575348c4e81a418257f254b6f8d225 (diff)
downloadqtwebengine-chromium-7b2ffa587235a47d4094787d72f38102089f402a.tar.gz
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/ui/message_center/public')
-rw-r--r--chromium/ui/message_center/public/cpp/BUILD.gn2
-rw-r--r--chromium/ui/message_center/public/cpp/features.cc12
-rw-r--r--chromium/ui/message_center/public/cpp/features.h19
-rw-r--r--chromium/ui/message_center/public/cpp/notification.cc16
4 files changed, 7 insertions, 42 deletions
diff --git a/chromium/ui/message_center/public/cpp/BUILD.gn b/chromium/ui/message_center/public/cpp/BUILD.gn
index a647bb534f5..6dc7ee3b7af 100644
--- a/chromium/ui/message_center/public/cpp/BUILD.gn
+++ b/chromium/ui/message_center/public/cpp/BUILD.gn
@@ -9,8 +9,6 @@ jumbo_component("cpp") {
output_name = "ui_message_center_cpp"
sources = [
- "features.cc",
- "features.h",
"message_center_constants.h",
"message_center_public_export.h",
"notification.cc",
diff --git a/chromium/ui/message_center/public/cpp/features.cc b/chromium/ui/message_center/public/cpp/features.cc
deleted file mode 100644
index 3b923d0e996..00000000000
--- a/chromium/ui/message_center/public/cpp/features.cc
+++ /dev/null
@@ -1,12 +0,0 @@
-// 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.
-
-#include "ui/message_center/public/cpp/features.h"
-
-namespace message_center {
-
-const base::Feature kNewStyleNotifications{"NewStyleNotifications",
- base::FEATURE_ENABLED_BY_DEFAULT};
-
-} // namespace message_center
diff --git a/chromium/ui/message_center/public/cpp/features.h b/chromium/ui/message_center/public/cpp/features.h
deleted file mode 100644
index dadaddbb22e..00000000000
--- a/chromium/ui/message_center/public/cpp/features.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2018 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 UI_MESSAGE_CENTER_PUBLIC_CPP_FEATURES_H_
-#define UI_MESSAGE_CENTER_PUBLIC_CPP_FEATURES_H_
-
-#include "base/feature_list.h"
-#include "ui/message_center/public/cpp/message_center_public_export.h"
-
-namespace message_center {
-
-// This feature controls whether the new (material design) style notifications
-// should be used.
-MESSAGE_CENTER_PUBLIC_EXPORT extern const base::Feature kNewStyleNotifications;
-
-} // namespace message_center
-
-#endif // UI_MESSAGE_CENTER_PUBLIC_CPP_FEATURES_H_
diff --git a/chromium/ui/message_center/public/cpp/notification.cc b/chromium/ui/message_center/public/cpp/notification.cc
index 25fe154b736..1f58c7ffe48 100644
--- a/chromium/ui/message_center/public/cpp/notification.cc
+++ b/chromium/ui/message_center/public/cpp/notification.cc
@@ -35,12 +35,10 @@ const gfx::ImageSkia CreateSolidColorImage(int width,
return gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
}
-gfx::Image DeepCopyImage(const gfx::Image& image) {
- if (image.IsEmpty())
- return gfx::Image();
- std::unique_ptr<gfx::ImageSkia> image_skia(
- new gfx::ImageSkia(*image.ToImageSkia()));
- return gfx::Image(*image_skia);
+// Returns an image created on the current thread that shares the same
+// underlying ImageSkia data as the original image.
+gfx::Image DuplicateImage(const gfx::Image& image) {
+ return image.IsEmpty() ? gfx::Image() : gfx::Image(image.AsImageSkia());
}
} // namespace
@@ -105,16 +103,16 @@ std::unique_ptr<Notification> Notification::DeepCopy(
bool include_icon_images) {
std::unique_ptr<Notification> notification_copy =
std::make_unique<Notification>(notification);
- notification_copy->set_icon(DeepCopyImage(notification_copy->icon()));
+ notification_copy->set_icon(DuplicateImage(notification_copy->icon()));
notification_copy->set_image(include_body_image
- ? DeepCopyImage(notification_copy->image())
+ ? DuplicateImage(notification_copy->image())
: gfx::Image());
notification_copy->set_small_image(
include_small_image ? notification_copy->small_image() : gfx::Image());
for (size_t i = 0; i < notification_copy->buttons().size(); i++) {
notification_copy->SetButtonIcon(
i, include_icon_images
- ? DeepCopyImage(notification_copy->buttons()[i].icon)
+ ? DuplicateImage(notification_copy->buttons()[i].icon)
: gfx::Image());
}
return notification_copy;