[NextBrowser] Fixed default avatar icon rendering logic as per M130 99/324599/2
authorTarun Verma <tarun1.verma@samsung.com>
Wed, 21 May 2025 08:52:54 +0000 (14:22 +0530)
committerBot Blink <blinkbot@samsung.com>
Wed, 21 May 2025 09:10:01 +0000 (09:10 +0000)
Change-Id: I16a5cd7fed46a4d839eefed2e60640f51b5c38a9
Signed-off-by: Tarun Verma <tarun1.verma@samsung.com>
chrome/browser/ui/samsung/samsung_account_manager.cc

index 3e0af3ab1ef5babb8748c90a8cdfaf2971d5823e..d3d4071de098f04b4f401e420237a48078e805e8 100644 (file)
@@ -310,15 +310,13 @@ void SamsungAccountManager::OnImageDecoded(bool isDefaultUserIcon,
             << isDefaultUserIcon;
   if (img.IsEmpty() && !isDefaultUserIcon) {
     base::FilePath image_path = base::FilePath(kDefaultUserIconPath);
-    std::optional<std::vector<uint8_t>> bytes =
-        base::ReadFileToBytes(image_path);
-    if (bytes) {
-      LOG(INFO) << "Read bytes success. size: " << bytes->size();
-      //SetUserIcon(
-                //TODO:[NextBrowser][Merging]
- //commented the code temporarily to fix the build error
-          //gfx::Image::CreateFrom1xPNGBytes(bytes->data(), bytes->size()));
-    }
+    std::string image_data;
+  bool read = base::ReadFileToString(image_path, &image_data);
+  LOG(INFO)<<"read: "<<read;
+  if (read) {
+    LOG(INFO) << "Read image_data success. size: " << image_data.size();
+    SetUserIcon(gfx::Image::CreateFrom1xPNGBytes(base::as_byte_span(image_data)));
+  }
   } else {
     LOG(INFO) << "Image decoded successfully";
     SetUserIcon(img);