summaryrefslogtreecommitdiffstats
path: root/components/omnibox
diff options
context:
space:
mode:
Diffstat (limited to 'components/omnibox')
-rw-r--r--components/omnibox/browser/autocomplete_classifier.cc9
-rw-r--r--components/omnibox/browser/autocomplete_controller.cc4
-rw-r--r--components/omnibox/browser/base_search_provider_unittest.cc4
-rw-r--r--components/omnibox/browser/keyword_provider_unittest.cc6
-rw-r--r--components/omnibox/browser/mock_autocomplete_provider_client.h3
-rw-r--r--components/omnibox/browser/omnibox_edit_model.cc3
-rw-r--r--components/omnibox/browser/omnibox_view.cc5
-rw-r--r--components/omnibox/browser/search_provider.cc4
-rw-r--r--components/omnibox/browser/search_suggestion_parser.cc11
-rw-r--r--components/omnibox/browser/shortcuts_backend.cc4
-rw-r--r--components/omnibox/browser/suggestion_answer.cc2
11 files changed, 32 insertions, 23 deletions
diff --git a/components/omnibox/browser/autocomplete_classifier.cc b/components/omnibox/browser/autocomplete_classifier.cc
index 26e349a6..cd60893 100644
--- a/components/omnibox/browser/autocomplete_classifier.cc
+++ b/components/omnibox/browser/autocomplete_classifier.cc
@@ -4,6 +4,8 @@
#include "components/omnibox/browser/autocomplete_classifier.h"
+#include <utility>
+
#include "base/auto_reset.h"
#include "build/build_config.h"
#include "components/metrics/proto/omnibox_event.pb.h"
@@ -36,10 +38,9 @@ const int AutocompleteClassifier::kDefaultOmniboxProviders =
AutocompleteClassifier::AutocompleteClassifier(
scoped_ptr<AutocompleteController> controller,
scoped_ptr<AutocompleteSchemeClassifier> scheme_classifier)
- : controller_(controller.Pass()),
- scheme_classifier_(scheme_classifier.Pass()),
- inside_classify_(false) {
-}
+ : controller_(std::move(controller)),
+ scheme_classifier_(std::move(scheme_classifier)),
+ inside_classify_(false) {}
AutocompleteClassifier::~AutocompleteClassifier() {
// We should only reach here after Shutdown() has been called.
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
index f040752..df7990d 100644
--- a/components/omnibox/browser/autocomplete_controller.cc
+++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -5,9 +5,9 @@
#include "components/omnibox/browser/autocomplete_controller.h"
#include <stddef.h>
-
#include <set>
#include <string>
+#include <utility>
#include "base/format_macros.h"
#include "base/logging.h"
@@ -172,7 +172,7 @@ AutocompleteController::AutocompleteController(
AutocompleteControllerDelegate* delegate,
int provider_types)
: delegate_(delegate),
- provider_client_(provider_client.Pass()),
+ provider_client_(std::move(provider_client)),
history_url_provider_(NULL),
keyword_provider_(NULL),
search_provider_(NULL),
diff --git a/components/omnibox/browser/base_search_provider_unittest.cc b/components/omnibox/browser/base_search_provider_unittest.cc
index afd1490..c09fe90 100644
--- a/components/omnibox/browser/base_search_provider_unittest.cc
+++ b/components/omnibox/browser/base_search_provider_unittest.cc
@@ -4,6 +4,8 @@
#include "components/omnibox/browser/base_search_provider.h"
+#include <utility>
+
#include "base/macros.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
@@ -72,7 +74,7 @@ class BaseSearchProviderTest : public testing::Test {
scoped_ptr<TemplateURLServiceClient>(), nullptr, nullptr,
base::Closure()));
client_.reset(new NiceMock<MockAutocompleteProviderClient>());
- client_->set_template_url_service(template_url_service.Pass());
+ client_->set_template_url_service(std::move(template_url_service));
provider_ = new NiceMock<TestBaseSearchProvider>(
AutocompleteProvider::TYPE_SEARCH, client_.get());
}
diff --git a/components/omnibox/browser/keyword_provider_unittest.cc b/components/omnibox/browser/keyword_provider_unittest.cc
index fa44fba..c0476a5 100644
--- a/components/omnibox/browser/keyword_provider_unittest.cc
+++ b/components/omnibox/browser/keyword_provider_unittest.cc
@@ -2,7 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "components/omnibox/browser/keyword_provider.h"
+
#include <stddef.h>
+#include <utility>
#include "base/command_line.h"
#include "base/macros.h"
@@ -12,7 +15,6 @@
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/browser/autocomplete_match.h"
#include "components/omnibox/browser/autocomplete_scheme_classifier.h"
-#include "components/omnibox/browser/keyword_provider.h"
#include "components/omnibox/browser/mock_autocomplete_provider_client.h"
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/search_engines/search_engines_switches.h"
@@ -111,7 +113,7 @@ void KeywordProviderTest::SetUpClientAndKeywordProvider() {
scoped_ptr<TemplateURLService> template_url_service(
new TemplateURLService(kTestData, arraysize(kTestData)));
client_.reset(new MockAutocompleteProviderClient());
- client_->set_template_url_service(template_url_service.Pass());
+ client_->set_template_url_service(std::move(template_url_service));
kw_provider_ = new KeywordProvider(client_.get(), nullptr);
}
diff --git a/components/omnibox/browser/mock_autocomplete_provider_client.h b/components/omnibox/browser/mock_autocomplete_provider_client.h
index 5367ba3..af390d3 100644
--- a/components/omnibox/browser/mock_autocomplete_provider_client.h
+++ b/components/omnibox/browser/mock_autocomplete_provider_client.h
@@ -6,6 +6,7 @@
#define COMPONENTS_OMNIBOX_BROWSER_MOCK_AUTOCOMPLETE_PROVIDER_CLIENT_H_
#include <string>
+#include <utility>
#include "base/macros.h"
#include "components/omnibox/browser/autocomplete_provider_client.h"
@@ -78,7 +79,7 @@ class MockAutocompleteProviderClient : public AutocompleteProviderClient {
MOCK_METHOD1(PrefetchImage, void(const GURL& url));
void set_template_url_service(scoped_ptr<TemplateURLService> service) {
- template_url_service_ = service.Pass();
+ template_url_service_ = std::move(service);
}
private:
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index 369a77d..03311cb 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <string>
+#include <utility>
#include "base/auto_reset.h"
#include "base/format_macros.h"
@@ -172,7 +173,7 @@ OmniboxEditModel::State::~State() {
OmniboxEditModel::OmniboxEditModel(OmniboxView* view,
OmniboxEditController* controller,
scoped_ptr<OmniboxClient> client)
- : client_(client.Pass()),
+ : client_(std::move(client)),
view_(view),
controller_(controller),
focus_state_(OMNIBOX_FOCUS_NONE),
diff --git a/components/omnibox/browser/omnibox_view.cc b/components/omnibox/browser/omnibox_view.cc
index bf9f8f8..6101def 100644
--- a/components/omnibox/browser/omnibox_view.cc
+++ b/components/omnibox/browser/omnibox_view.cc
@@ -7,6 +7,8 @@
#include "components/omnibox/browser/omnibox_view.h"
+#include <utility>
+
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -176,8 +178,7 @@ OmniboxView::OmniboxView(OmniboxEditController* controller,
: controller_(controller) {
// |client| can be null in tests.
if (client) {
- model_.reset(
- new OmniboxEditModel(this, controller, client.Pass()));
+ model_.reset(new OmniboxEditModel(this, controller, std::move(client)));
}
}
diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/browser/search_provider.cc
index 72cb2fe..75eddbe 100644
--- a/components/omnibox/browser/search_provider.cc
+++ b/components/omnibox/browser/search_provider.cc
@@ -5,9 +5,9 @@
#include "components/omnibox/browser/search_provider.h"
#include <stddef.h>
-
#include <algorithm>
#include <cmath>
+#include <utility>
#include "base/base64.h"
#include "base/bind.h"
@@ -941,7 +941,7 @@ void SearchProvider::ConvertResultsToAutocompleteMatches() {
SearchSuggestionParser::SuggestResult verbatim(
trimmed_verbatim, AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED,
trimmed_verbatim, base::string16(), base::string16(), answer_contents,
- answer_type, answer.Pass(), std::string(), std::string(), false,
+ answer_type, std::move(answer), std::string(), std::string(), false,
verbatim_relevance, relevance_from_server, false, trimmed_verbatim);
AddMatchToMap(verbatim, std::string(), did_not_accept_default_suggestion,
false, keyword_url != NULL, &map);
diff --git a/components/omnibox/browser/search_suggestion_parser.cc b/components/omnibox/browser/search_suggestion_parser.cc
index 95558ec..d1cbc04 100644
--- a/components/omnibox/browser/search_suggestion_parser.cc
+++ b/components/omnibox/browser/search_suggestion_parser.cc
@@ -5,8 +5,8 @@
#include "components/omnibox/browser/search_suggestion_parser.h"
#include <stddef.h>
-
#include <algorithm>
+#include <utility>
#include "base/i18n/icu_string_conversions.h"
#include "base/json/json_string_value_serializer.h"
@@ -93,7 +93,7 @@ SearchSuggestionParser::SuggestResult::SuggestResult(
suggest_query_params_(suggest_query_params),
answer_contents_(answer_contents),
answer_type_(answer_type),
- answer_(answer.Pass()),
+ answer_(std::move(answer)),
should_prefetch_(should_prefetch) {
match_contents_ = match_contents;
DCHECK(!match_contents_.empty());
@@ -380,7 +380,7 @@ scoped_ptr<base::Value> SearchSuggestionParser::DeserializeJsonData(
int error_code = 0;
scoped_ptr<base::Value> data = deserializer.Deserialize(&error_code, NULL);
if (error_code == 0)
- return data.Pass();
+ return data;
}
return scoped_ptr<base::Value>();
}
@@ -550,8 +550,9 @@ bool SearchSuggestionParser::ParseSuggestResults(
base::CollapseWhitespace(suggestion, false), match_type,
base::CollapseWhitespace(match_contents, false),
match_contents_prefix, annotation, answer_contents, answer_type_str,
- answer.Pass(), suggest_query_params, deletion_url, is_keyword_result,
- relevance, relevances != NULL, should_prefetch, trimmed_input));
+ std::move(answer), suggest_query_params, deletion_url,
+ is_keyword_result, relevance, relevances != NULL, should_prefetch,
+ trimmed_input));
}
}
results->relevances_from_server = relevances != NULL;
diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc
index 8bfa6e6..f020ed1 100644
--- a/components/omnibox/browser/shortcuts_backend.cc
+++ b/components/omnibox/browser/shortcuts_backend.cc
@@ -5,9 +5,9 @@
#include "components/omnibox/browser/shortcuts_backend.h"
#include <stddef.h>
-
#include <map>
#include <string>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -72,7 +72,7 @@ ShortcutsBackend::ShortcutsBackend(
base::FilePath database_path,
bool suppress_db)
: template_url_service_(template_url_service),
- search_terms_data_(search_terms_data.Pass()),
+ search_terms_data_(std::move(search_terms_data)),
current_state_(NOT_INITIALIZED),
history_service_observer_(this),
main_runner_(base::ThreadTaskRunnerHandle::Get()),
diff --git a/components/omnibox/browser/suggestion_answer.cc b/components/omnibox/browser/suggestion_answer.cc
index cf6f2b4..85c48d3 100644
--- a/components/omnibox/browser/suggestion_answer.cc
+++ b/components/omnibox/browser/suggestion_answer.cc
@@ -198,7 +198,7 @@ scoped_ptr<SuggestionAnswer> SuggestionAnswer::ParseAnswer(
!ImageLine::ParseImageLine(second_line_json, &result->second_line_))
return nullptr;
- return result.Pass();
+ return result;
}
bool SuggestionAnswer::Equals(const SuggestionAnswer& answer) const {