| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/instant/instant_page.h" | 5 #include "chrome/browser/instant/instant_page.h" | 
| 6 | 6 | 
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" | 
| 8 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" | 
| 9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" | 
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 88   Send(new ChromeViewMsg_SearchBoxSetDisplayInstantResults( | 88   Send(new ChromeViewMsg_SearchBoxSetDisplayInstantResults( | 
| 89       routing_id(), display_instant_results)); | 89       routing_id(), display_instant_results)); | 
| 90 } | 90 } | 
| 91 | 91 | 
| 92 void InstantPage::KeyCaptureChanged(bool is_key_capture_enabled) { | 92 void InstantPage::KeyCaptureChanged(bool is_key_capture_enabled) { | 
| 93   Send(new ChromeViewMsg_SearchBoxKeyCaptureChanged( | 93   Send(new ChromeViewMsg_SearchBoxKeyCaptureChanged( | 
| 94       routing_id(), is_key_capture_enabled)); | 94       routing_id(), is_key_capture_enabled)); | 
| 95 } | 95 } | 
| 96 | 96 | 
| 97 void InstantPage::SendMostVisitedItems( | 97 void InstantPage::SendMostVisitedItems( | 
| 98     const std::vector<MostVisitedItem>& items) { | 98     const std::vector<InstantMostVisitedItem>& items) { | 
| 99   Send(new ChromeViewMsg_InstantMostVisitedItemsChanged(routing_id(), items)); | 99   Send(new ChromeViewMsg_SearchBoxMostVisitedItemsChanged(routing_id(), items)); | 
| 100 } | 100 } | 
| 101 | 101 | 
| 102 InstantPage::InstantPage(Delegate* delegate) | 102 InstantPage::InstantPage(Delegate* delegate) | 
| 103     : delegate_(delegate), | 103     : delegate_(delegate), | 
| 104       supports_instant_(false) { | 104       supports_instant_(false) { | 
| 105 } | 105 } | 
| 106 | 106 | 
| 107 void InstantPage::SetContents(content::WebContents* contents) { | 107 void InstantPage::SetContents(content::WebContents* contents) { | 
| 108   Observe(contents); | 108   Observe(contents); | 
| 109 } | 109 } | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 166                         OnInstantSupportDetermined) | 166                         OnInstantSupportDetermined) | 
| 167     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantOverlay, | 167     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ShowInstantOverlay, | 
| 168                         OnShowInstantOverlay) | 168                         OnShowInstantOverlay) | 
| 169     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusOmnibox, OnFocusOmnibox) | 169     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_FocusOmnibox, OnFocusOmnibox) | 
| 170     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, | 170     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, | 
| 171                         OnStartCapturingKeyStrokes); | 171                         OnStartCapturingKeyStrokes); | 
| 172     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, | 172     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, | 
| 173                         OnStopCapturingKeyStrokes); | 173                         OnStopCapturingKeyStrokes); | 
| 174     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate, | 174     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxNavigate, | 
| 175                         OnSearchBoxNavigate); | 175                         OnSearchBoxNavigate); | 
| 176     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantDeleteMostVisitedItem, | 176     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxDeleteMostVisitedItem, | 
| 177                         OnDeleteMostVisitedItem); | 177                         OnDeleteMostVisitedItem); | 
| 178     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantUndoMostVisitedDeletion, | 178     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxUndoMostVisitedDeletion, | 
| 179                         OnUndoMostVisitedDeletion); | 179                         OnUndoMostVisitedDeletion); | 
| 180     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_InstantUndoAllMostVisitedDeletions, | 180     IPC_MESSAGE_HANDLER(ChromeViewHostMsg_SearchBoxUndoAllMostVisitedDeletions, | 
| 181                         OnUndoAllMostVisitedDeletions); | 181                         OnUndoAllMostVisitedDeletions); | 
| 182     IPC_MESSAGE_UNHANDLED(handled = false) | 182     IPC_MESSAGE_UNHANDLED(handled = false) | 
| 183   IPC_END_MESSAGE_MAP() | 183   IPC_END_MESSAGE_MAP() | 
| 184   return handled; | 184   return handled; | 
| 185 } | 185 } | 
| 186 | 186 | 
| 187 void InstantPage::RenderViewGone(base::TerminationStatus /* status */) { | 187 void InstantPage::RenderViewGone(base::TerminationStatus /* status */) { | 
| 188   if (ShouldProcessRenderViewGone()) | 188   if (ShouldProcessRenderViewGone()) | 
| 189     delegate_->InstantPageRenderViewGone(contents()); | 189     delegate_->InstantPageRenderViewGone(contents()); | 
| 190 } | 190 } | 
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 263                                       const GURL& url, | 263                                       const GURL& url, | 
| 264                                       content::PageTransition transition, | 264                                       content::PageTransition transition, | 
| 265                                       WindowOpenDisposition disposition) { | 265                                       WindowOpenDisposition disposition) { | 
| 266   if (contents()->IsActiveEntry(page_id)) { | 266   if (contents()->IsActiveEntry(page_id)) { | 
| 267     OnInstantSupportDetermined(page_id, true); | 267     OnInstantSupportDetermined(page_id, true); | 
| 268     if (ShouldProcessNavigateToURL()) | 268     if (ShouldProcessNavigateToURL()) | 
| 269       delegate_->NavigateToURL(contents(), url, transition, disposition); | 269       delegate_->NavigateToURL(contents(), url, transition, disposition); | 
| 270   } | 270   } | 
| 271 } | 271 } | 
| 272 | 272 | 
| 273 void InstantPage::OnDeleteMostVisitedItem(const GURL& url) { | 273 void InstantPage::OnDeleteMostVisitedItem(uint64 restricted_id) { | 
| 274   delegate_->DeleteMostVisitedItem(url); | 274   delegate_->DeleteMostVisitedItem(restricted_id); | 
| 275 } | 275 } | 
| 276 | 276 | 
| 277 void InstantPage::OnUndoMostVisitedDeletion(const GURL& url) { | 277 void InstantPage::OnUndoMostVisitedDeletion(uint64 restricted_id) { | 
| 278   delegate_->UndoMostVisitedDeletion(url); | 278   delegate_->UndoMostVisitedDeletion(restricted_id); | 
| 279 } | 279 } | 
| 280 | 280 | 
| 281 void InstantPage::OnUndoAllMostVisitedDeletions() { | 281 void InstantPage::OnUndoAllMostVisitedDeletions() { | 
| 282   delegate_->UndoAllMostVisitedDeletions(); | 282   delegate_->UndoAllMostVisitedDeletions(); | 
| 283 } | 283 } | 
| OLD | NEW | 
|---|