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) | |
|
samarth
2012/12/07 01:14:34
nit: fix indent
Shishir
2012/12/07 21:01:25
Done.
| |
| 107 return; | |
| 108 delegate_->AboutToNavigateMainFrame(url); | |
| 109 } | |
| 110 | |
| 111 void InstantClient::AboutToOpenURL(const GURL& url) { | |
| 112 delegate_->AboutToNavigateMainFrame(url); | |
| 113 } | |
| 114 | |
| 100 void InstantClient::SetSuggestions( | 115 void InstantClient::SetSuggestions( |
| 101 int page_id, | 116 int page_id, |
| 102 const std::vector<InstantSuggestion>& suggestions) { | 117 const std::vector<InstantSuggestion>& suggestions) { |
| 103 if (web_contents()->IsActiveEntry(page_id)) | 118 if (web_contents()->IsActiveEntry(page_id)) |
| 104 delegate_->SetSuggestions(suggestions); | 119 delegate_->SetSuggestions(suggestions); |
| 105 } | 120 } |
| 106 | 121 |
| 107 void InstantClient::InstantSupportDetermined(int page_id, bool result) { | 122 void InstantClient::InstantSupportDetermined(int page_id, bool result) { |
| 108 if (web_contents()->IsActiveEntry(page_id)) | 123 if (web_contents()->IsActiveEntry(page_id)) |
| 109 delegate_->InstantSupportDetermined(result); | 124 delegate_->InstantSupportDetermined(result); |
| 110 } | 125 } |
| 111 | 126 |
| 112 void InstantClient::ShowInstantPreview(int page_id, | 127 void InstantClient::ShowInstantPreview(int page_id, |
| 113 InstantShownReason reason, | 128 InstantShownReason reason, |
| 114 int height, | 129 int height, |
| 115 InstantSizeUnits units) { | 130 InstantSizeUnits units) { |
| 116 if (web_contents()->IsActiveEntry(page_id)) | 131 if (web_contents()->IsActiveEntry(page_id)) |
| 117 delegate_->ShowInstantPreview(reason, height, units); | 132 delegate_->ShowInstantPreview(reason, height, units); |
| 118 } | 133 } |
| 119 | 134 |
| 120 void InstantClient::StartCapturingKeyStrokes(int page_id) { | 135 void InstantClient::StartCapturingKeyStrokes(int page_id) { |
| 121 if (web_contents()->IsActiveEntry(page_id)) | 136 if (web_contents()->IsActiveEntry(page_id)) |
| 122 delegate_->StartCapturingKeyStrokes(); | 137 delegate_->StartCapturingKeyStrokes(); |
| 123 } | 138 } |
| 124 | 139 |
| 125 void InstantClient::StopCapturingKeyStrokes(int page_id) { | 140 void InstantClient::StopCapturingKeyStrokes(int page_id) { |
| 126 if (web_contents()->IsActiveEntry(page_id)) | 141 if (web_contents()->IsActiveEntry(page_id)) |
| 127 delegate_->StopCapturingKeyStrokes(); | 142 delegate_->StopCapturingKeyStrokes(); |
| 128 } | 143 } |
| OLD | NEW |