Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_client.h" | 5 #include "chrome/browser/instant/instant_client.h" | 
| 6 | 6 | 
| 7 #include "chrome/common/render_messages.h" | 7 #include "chrome/common/render_messages.h" | 
| 8 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" | 
| 9 | 9 | 
| 10 InstantClient::Delegate::~Delegate() { | 10 InstantClient::Delegate::~Delegate() { | 
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 ShowInstantPreview) | 90 ShowInstantPreview) | 
| 91 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, | 91 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StartCapturingKeyStrokes, | 
| 92 StartCapturingKeyStrokes); | 92 StartCapturingKeyStrokes); | 
| 93 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, | 93 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_StopCapturingKeyStrokes, | 
| 94 StopCapturingKeyStrokes); | 94 StopCapturingKeyStrokes); | 
| 95 IPC_MESSAGE_UNHANDLED(handled = false) | 95 IPC_MESSAGE_UNHANDLED(handled = false) | 
| 96 IPC_END_MESSAGE_MAP() | 96 IPC_END_MESSAGE_MAP() | 
| 97 return handled; | 97 return handled; | 
| 98 } | 98 } | 
| 99 | 99 | 
| 100 void InstantClient::DidCommitProvisionalLoadForFrame( | |
| 101 int64 frame_id, | |
| 102 bool is_main_frame, | |
| 103 const GURL& url, | |
| 104 content::PageTransition transition_type, | |
| 105 content::RenderViewHost* render_view_host) { | |
| 106 if (!is_main_frame) | |
| 107 return; | |
| 108 LOG(ERROR) << "***** DidCommitProvisionalLoadForFrame: " << url; | |
| 
 
sky
2012/12/06 22:37:29
remove logging.
 
Shishir
2012/12/06 23:20:30
Done.
 
 | |
| 109 delegate_->InstantClientAboutToNavigate(url); | |
| 
 
sky
2012/12/06 22:37:29
Maybe name this InstantClientAboutToNativeMainFram
 
Shishir
2012/12/06 23:20:30
Changed to AboutToNativeMainFrame as Samarth point
 
 | |
| 110 } | |
| 111 | |
| 112 void InstantClient::AboutToOpenURL(const GURL& url) { | |
| 113 LOG(ERROR) << "***** AboutToOpenURL: " << url; | |
| 114 delegate_->InstantClientAboutToNavigate(url); | |
| 115 } | |
| 116 | |
| 100 void InstantClient::SetSuggestions( | 117 void InstantClient::SetSuggestions( | 
| 101 int page_id, | 118 int page_id, | 
| 102 const std::vector<InstantSuggestion>& suggestions) { | 119 const std::vector<InstantSuggestion>& suggestions) { | 
| 103 if (web_contents()->IsActiveEntry(page_id)) | 120 if (web_contents()->IsActiveEntry(page_id)) | 
| 104 delegate_->SetSuggestions(suggestions); | 121 delegate_->SetSuggestions(suggestions); | 
| 105 } | 122 } | 
| 106 | 123 | 
| 107 void InstantClient::InstantSupportDetermined(int page_id, bool result) { | 124 void InstantClient::InstantSupportDetermined(int page_id, bool result) { | 
| 108 if (web_contents()->IsActiveEntry(page_id)) | 125 if (web_contents()->IsActiveEntry(page_id)) | 
| 109 delegate_->InstantSupportDetermined(result); | 126 delegate_->InstantSupportDetermined(result); | 
| 110 } | 127 } | 
| 111 | 128 | 
| 112 void InstantClient::ShowInstantPreview(int page_id, | 129 void InstantClient::ShowInstantPreview(int page_id, | 
| 113 InstantShownReason reason, | 130 InstantShownReason reason, | 
| 114 int height, | 131 int height, | 
| 115 InstantSizeUnits units) { | 132 InstantSizeUnits units) { | 
| 116 if (web_contents()->IsActiveEntry(page_id)) | 133 if (web_contents()->IsActiveEntry(page_id)) | 
| 117 delegate_->ShowInstantPreview(reason, height, units); | 134 delegate_->ShowInstantPreview(reason, height, units); | 
| 118 } | 135 } | 
| 119 | 136 | 
| 120 void InstantClient::StartCapturingKeyStrokes(int page_id) { | 137 void InstantClient::StartCapturingKeyStrokes(int page_id) { | 
| 121 if (web_contents()->IsActiveEntry(page_id)) | 138 if (web_contents()->IsActiveEntry(page_id)) | 
| 122 delegate_->StartCapturingKeyStrokes(); | 139 delegate_->StartCapturingKeyStrokes(); | 
| 123 } | 140 } | 
| 124 | 141 | 
| 125 void InstantClient::StopCapturingKeyStrokes(int page_id) { | 142 void InstantClient::StopCapturingKeyStrokes(int page_id) { | 
| 126 if (web_contents()->IsActiveEntry(page_id)) | 143 if (web_contents()->IsActiveEntry(page_id)) | 
| 127 delegate_->StopCapturingKeyStrokes(); | 144 delegate_->StopCapturingKeyStrokes(); | 
| 128 } | 145 } | 
| OLD | NEW |