| 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/ui/search/search_ipc_router.h" | 5 #include "chrome/browser/ui/search/search_ipc_router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/search/search.h" | 10 #include "chrome/browser/search/search.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 void SearchIPCRouter::SetSuggestionToPrefetch( | 95 void SearchIPCRouter::SetSuggestionToPrefetch( |
| 96 const InstantSuggestion& suggestion) { | 96 const InstantSuggestion& suggestion) { |
| 97 if (!policy_->ShouldSendSetSuggestionToPrefetch()) | 97 if (!policy_->ShouldSendSetSuggestionToPrefetch()) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 Send(new ChromeViewMsg_SearchBoxSetSuggestionToPrefetch(routing_id(), | 100 Send(new ChromeViewMsg_SearchBoxSetSuggestionToPrefetch(routing_id(), |
| 101 suggestion)); | 101 suggestion)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 void SearchIPCRouter::SetOmniboxStartMargin(int start_margin) { | |
| 105 if (!policy_->ShouldSendSetOmniboxStartMargin()) | |
| 106 return; | |
| 107 | |
| 108 Send(new ChromeViewMsg_SearchBoxMarginChange(routing_id(), start_margin)); | |
| 109 } | |
| 110 | |
| 111 void SearchIPCRouter::SetInputInProgress(bool input_in_progress) { | 104 void SearchIPCRouter::SetInputInProgress(bool input_in_progress) { |
| 112 if (!policy_->ShouldSendSetInputInProgress(is_active_tab_)) | 105 if (!policy_->ShouldSendSetInputInProgress(is_active_tab_)) |
| 113 return; | 106 return; |
| 114 | 107 |
| 115 Send(new ChromeViewMsg_SearchBoxSetInputInProgress(routing_id(), | 108 Send(new ChromeViewMsg_SearchBoxSetInputInProgress(routing_id(), |
| 116 input_in_progress)); | 109 input_in_progress)); |
| 117 } | 110 } |
| 118 | 111 |
| 119 void SearchIPCRouter::OmniboxFocusChanged(OmniboxFocusState state, | 112 void SearchIPCRouter::OmniboxFocusChanged(OmniboxFocusState state, |
| 120 OmniboxFocusChangeReason reason) { | 113 OmniboxFocusChangeReason reason) { |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 334 |
| 342 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { | 335 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { |
| 343 DCHECK(delegate); | 336 DCHECK(delegate); |
| 344 delegate_ = delegate; | 337 delegate_ = delegate; |
| 345 } | 338 } |
| 346 | 339 |
| 347 void SearchIPCRouter::set_policy_for_testing(scoped_ptr<Policy> policy) { | 340 void SearchIPCRouter::set_policy_for_testing(scoped_ptr<Policy> policy) { |
| 348 DCHECK(policy.get()); | 341 DCHECK(policy.get()); |
| 349 policy_.reset(policy.release()); | 342 policy_.reset(policy.release()); |
| 350 } | 343 } |
| OLD | NEW |