Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / search / search_tab_helper.cc
index 696eca0..133b9d1 100644 (file)
@@ -322,10 +322,11 @@ void SearchTabHelper::NavigationEntryCommitted(
   if (!load_details.is_main_frame)
     return;
 
-  // TODO(kmadhusu): Set the page initial states (such as omnibox margin, etc)
-  // from here. Please refer to crbug.com/247517 for more details.
   if (chrome::ShouldAssignURLToInstantRenderer(web_contents_->GetURL(),
                                                profile())) {
+    InstantService* instant_service =
+        InstantServiceFactory::GetForProfile(profile());
+    ipc_router_.SetOmniboxStartMargin(instant_service->omnibox_start_margin());
     ipc_router_.SetDisplayInstantResults();
   }
 
@@ -384,6 +385,10 @@ void SearchTabHelper::MostVisitedItemsChanged(
   ipc_router_.SendMostVisitedItems(items_copy);
 }
 
+void SearchTabHelper::OmniboxStartMarginChanged(int omnibox_start_margin) {
+  ipc_router_.SetOmniboxStartMargin(omnibox_start_margin);
+}
+
 void SearchTabHelper::MaybeRemoveMostVisitedItems(
     std::vector<InstantMostVisitedItem>* items) {
 // The code below uses APIs not available on Android and the experiment should