[NextBrowser] Migration of "History page hybridnavigation" 84/324584/4
authorshubham.garg <shubham.garg@samsung.com>
Wed, 21 May 2025 04:48:35 +0000 (10:18 +0530)
committerBot Blink <blinkbot@samsung.com>
Fri, 30 May 2025 06:51:58 +0000 (06:51 +0000)
Change-Id: I9998587df8cc11f0ac2e9725cd347b518fe5d771
Signed-off-by: shubham.garg <shubham.garg@samsung.com>
chrome/browser/resources/history/history.ts
chrome/browser/resources/history/history_list.html
chrome/browser/resources/history/history_list.ts
chrome/browser/ui/samsung/hybrid_navigation_controller.cc
chrome/browser/ui/webui/history/history_ui.cc
ui/webui/resources/js/samsung/hybridnavigation.js

index 90cac9ef363267c6395156dec1022a3a3f617d74..735f1162f650e6e2ba28538353d8ae5e813f05ec 100644 (file)
@@ -32,3 +32,5 @@ export {HistorySearchedLabelElement} from './searched_label.js';
 export {HistorySideBarElement} from './side_bar.js';
 export {HistorySyncedDeviceCardElement} from './synced_device_card.js';
 export {HistorySyncedDeviceManagerElement} from './synced_device_manager.js';
+import { HybridNavigation } from 'chrome://resources/js/samsung/hybridnavigation.js';
+setTimeout(HybridNavigation,1250);
\ No newline at end of file
index 3a4eef7e6b8f7f36be8e1d4b6722b10404d89f61..e23757fcc21493afccc9b9d2a22d99daa5d32e98 100644 (file)
@@ -51,7 +51,7 @@
 
     <cr-lazy-render id="dialog">
       <template>
-        <cr-dialog consume-keydown-event>
+        <cr-dialog consume-keydown-event class="historyDeletePopup">
           <div slot="title" id="title">$i18n{removeSelected}</div>
           <div slot="body" id="body">$i18n{deleteWarning}</div>
           <div slot="button-container">
index a21c455358746f9476e5db91df699538902c3e48..35729df42e027fe746776d773f635e23bef1d691 100644 (file)
@@ -28,6 +28,7 @@ import type {HistoryEntry, HistoryQuery, QueryState} from './externs.js';
 import type {HistoryItemElement} from './history_item.js';
 import {searchResultsTitle} from './history_item.js';
 import {getTemplate} from './history_list.html.js';
+import {changeIsPopUpOpened} from 'chrome://resources/js/samsung/hybridnavigation.js';
 
 export interface ActionMenuModel {
   index: number;
@@ -377,6 +378,7 @@ export class HistoryListElement extends HistoryListElementBase {
     const dialog = this.$.dialog.getIfExists();
     assert(dialog);
     dialog.close();
+    changeIsPopUpOpened('close');
   }
 
   private onDialogCancelClick_() {
@@ -385,6 +387,7 @@ export class HistoryListElement extends HistoryListElementBase {
     const dialog = this.$.dialog.getIfExists();
     assert(dialog);
     dialog.close();
+    changeIsPopUpOpened('close');
   }
 
   /**
index 899cb54e76dd3a9c3b57fae3db1d5e2d47263c09..0326fbe170d88c5af715db4dcaefbcb98f6a8749 100644 (file)
@@ -795,6 +795,10 @@ bool HybridNavigationController::isInternalPage() {
       LOG(INFO) << "Sub Settings Page";
       return true;
     }
+    if (url.rfind(u"chrome://history", 0) == 0) {
+      LOG(INFO) << "Sub history Page";
+      return true;
+    }
 
   return false;
 }
index 03498e5e09b90e8848d1c59e55a4de040d26946e..35a10b819c78ba7f0097902d71c95106ac547c5e 100644 (file)
 #include "ui/base/webui/web_ui_util.h"
 #include "ui/webui/resources/cr_components/commerce/shopping_service.mojom.h"
 
+#if defined(SAMSUNG_NEXT_BROWSER)
+#include "chrome/browser/ui/webui/samsung/samsung_featured_handler.h"
+#endif
+
 namespace {
 
 constexpr char kIsUserSignedInKey[] = "isUserSignedIn";
@@ -293,6 +297,10 @@ HistoryUI::HistoryUI(content::WebUI* web_ui)
   browsing_history_handler_ptr->StartQueryHistory();
   web_ui->AddMessageHandler(std::make_unique<MetricsHandler>());
 
+  #if defined(SAMSUNG_NEXT_BROWSER)
+   web_ui->AddMessageHandler(std::make_unique<SamsungFeaturedHandler>());
+  #endif
+
   auto foreign_session_handler =
       std::make_unique<browser_sync::ForeignSessionHandler>();
   browser_sync::ForeignSessionHandler* foreign_session_handler_ptr =
index e31da447e4a15a13a2707eb6a5a20690eb881805..405246ed3326ac8360f086f1601a3d315d0318de 100644 (file)
@@ -174,6 +174,13 @@ function mutationObserver(targetNodes) {
         // else
         // {
             observer.observe(targetNode, config);
+
+            if(window.location.host == 'history' && targetNode.tagName == "CR-BUTTON"){
+                targetNode.addEventListener('click',()=>{
+                    // refreshList();
+                    changeIsPopUpOpened('historyDeletePopup');
+                });
+            }
         // }
     });
     observer.observe(document,config);
@@ -458,6 +465,7 @@ function hybridEnable(fx=500,fy=80){
     onLoad();
     currentElement = navigableElements[3];
 }
+HybridNavigation.refreshList = refreshList;
 hybridEnable();
 }
 
@@ -469,6 +477,7 @@ function getZoomLevel()
 let changeIsPopUpOpened = function(value)
 {
     popupToOpen = value;
+    HybridNavigation.refreshList();
     //console.log(popupToOpen);
 }
 export{HybridNavigation,changeIsPopUpOpened};
\ No newline at end of file