Index: chrome/browser/ui/search/instant_page.cc |
diff --git a/chrome/browser/ui/search/instant_page.cc b/chrome/browser/ui/search/instant_page.cc |
index 66cb00a4169478f703073b143ecf800335b2eafe..8ddabcaedd77ae3bcf9d655112abda40b2f8f1fa 100644 |
--- a/chrome/browser/ui/search/instant_page.cc |
+++ b/chrome/browser/ui/search/instant_page.cc |
@@ -54,10 +54,16 @@ void InstantPage::Submit(const string16& text) { |
} |
void InstantPage::Cancel(const string16& text) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxCancel(routing_id(), text)); |
} |
void InstantPage::SetPopupBounds(const gfx::Rect& bounds) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxPopupResize(routing_id(), bounds)); |
} |
@@ -67,6 +73,9 @@ void InstantPage::SetOmniboxBounds(const gfx::Rect& bounds) { |
} |
void InstantPage::InitializeFonts() { |
+ if (off_the_record_) |
+ return; |
+ |
#if defined(OS_MACOSX) |
// This value should be kept in sync with OmniboxViewMac::GetFieldFont. |
const gfx::Font omnibox_font("Helvetica Neue", 16); |
@@ -83,14 +92,23 @@ void InstantPage::InitializeFonts() { |
void InstantPage::SendAutocompleteResults( |
const std::vector<InstantAutocompleteResult>& results) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxAutocompleteResults(routing_id(), results)); |
} |
void InstantPage::UpOrDownKeyPressed(int count) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxUpOrDownKeyPressed(routing_id(), count)); |
} |
void InstantPage::EscKeyPressed() { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxEscKeyPressed(routing_id())); |
} |
@@ -98,32 +116,50 @@ void InstantPage::CancelSelection(const string16& user_text, |
size_t selection_start, |
size_t selection_end, |
bool verbatim) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxCancelSelection( |
routing_id(), user_text, verbatim, selection_start, selection_end)); |
} |
void InstantPage::SendThemeBackgroundInfo( |
const ThemeBackgroundInfo& theme_info) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxThemeChanged(routing_id(), theme_info)); |
} |
void InstantPage::SetDisplayInstantResults(bool display_instant_results) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxSetDisplayInstantResults( |
routing_id(), display_instant_results)); |
} |
void InstantPage::FocusChanged(OmniboxFocusState state, |
OmniboxFocusChangeReason reason) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxFocusChanged(routing_id(), state, reason)); |
} |
void InstantPage::SetInputInProgress(bool input_in_progress) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxSetInputInProgress( |
routing_id(), input_in_progress)); |
} |
void InstantPage::SendMostVisitedItems( |
const std::vector<InstantMostVisitedItem>& items) { |
+ if (off_the_record_) |
+ return; |
+ |
Send(new ChromeViewMsg_SearchBoxMostVisitedItemsChanged(routing_id(), items)); |
} |
@@ -131,9 +167,11 @@ void InstantPage::ToggleVoiceSearch() { |
Send(new ChromeViewMsg_SearchBoxToggleVoiceSearch(routing_id())); |
} |
-InstantPage::InstantPage(Delegate* delegate, const std::string& instant_url) |
+InstantPage::InstantPage(Delegate* delegate, const std::string& instant_url, |
+ bool off_the_record) |
: delegate_(delegate), |
- instant_url_(instant_url) { |
+ instant_url_(instant_url), |
+ off_the_record_(off_the_record) { |
} |
void InstantPage::SetContents(content::WebContents* web_contents) { |