| 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 15 matching lines...) Expand all Loading... |
| 26 if (!base::IsAsciiAlpha(*it) && !base::IsAsciiDigit(*it)) | 26 if (!base::IsAsciiAlpha(*it) && !base::IsAsciiDigit(*it)) |
| 27 return false; | 27 return false; |
| 28 } | 28 } |
| 29 return true; | 29 return true; |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 SearchIPCRouter::SearchIPCRouter(content::WebContents* web_contents, | 34 SearchIPCRouter::SearchIPCRouter(content::WebContents* web_contents, |
| 35 Delegate* delegate, | 35 Delegate* delegate, |
| 36 scoped_ptr<Policy> policy) | 36 std::unique_ptr<Policy> policy) |
| 37 : WebContentsObserver(web_contents), | 37 : WebContentsObserver(web_contents), |
| 38 delegate_(delegate), | 38 delegate_(delegate), |
| 39 policy_(std::move(policy)), | 39 policy_(std::move(policy)), |
| 40 commit_counter_(0), | 40 commit_counter_(0), |
| 41 is_active_tab_(false) { | 41 is_active_tab_(false) { |
| 42 DCHECK(web_contents); | 42 DCHECK(web_contents); |
| 43 DCHECK(delegate); | 43 DCHECK(delegate); |
| 44 DCHECK(policy_.get()); | 44 DCHECK(policy_.get()); |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 return; | 329 return; |
| 330 | 330 |
| 331 delegate_->OnHistorySyncCheck(); | 331 delegate_->OnHistorySyncCheck(); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { | 334 void SearchIPCRouter::set_delegate_for_testing(Delegate* delegate) { |
| 335 DCHECK(delegate); | 335 DCHECK(delegate); |
| 336 delegate_ = delegate; | 336 delegate_ = delegate; |
| 337 } | 337 } |
| 338 | 338 |
| 339 void SearchIPCRouter::set_policy_for_testing(scoped_ptr<Policy> policy) { | 339 void SearchIPCRouter::set_policy_for_testing(std::unique_ptr<Policy> policy) { |
| 340 DCHECK(policy.get()); | 340 DCHECK(policy.get()); |
| 341 policy_.reset(policy.release()); | 341 policy_.reset(policy.release()); |
| 342 } | 342 } |
| OLD | NEW |