diff options
author | dcheng <dcheng@chromium.org> | 2015-12-26 14:35:30 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-26 22:36:29 +0000 |
commit | 4a9d9829bc889e6a2cc02dbc443d3032e1d2c81f (patch) | |
tree | 0e623f2ec093577cf8ed8961ea428c66e6d7ed12 | |
parent | 1140ec269604bc588e2d3b61171c713a98135ea8 (diff) | |
download | chromium_src-4a9d9829bc889e6a2cc02dbc443d3032e1d2c81f.zip chromium_src-4a9d9829bc889e6a2cc02dbc443d3032e1d2c81f.tar.gz chromium_src-4a9d9829bc889e6a2cc02dbc443d3032e1d2c81f.tar.bz2 |
Convert Pass()→std::move() in //chrome/browser/ui
☃
BUG=557422
R=avi@chromium.org
TBR=sky@chromium.org
Review URL: https://codereview.chromium.org/1550053002
Cr-Commit-Position: refs/heads/master@{#366913}
166 files changed, 615 insertions, 487 deletions
diff --git a/chrome/browser/ui/app_list/app_list_model_builder.cc b/chrome/browser/ui/app_list/app_list_model_builder.cc index 9712158..c58a50e 100644 --- a/chrome/browser/ui/app_list/app_list_model_builder.cc +++ b/chrome/browser/ui/app_list/app_list_model_builder.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/app_list_model_builder.h" +#include <utility> + #include "chrome/browser/ui/app_list/app_list_syncable_service.h" #include "ui/app_list/app_list_item.h" #include "ui/app_list/app_list_model.h" @@ -42,10 +44,10 @@ void AppListModelBuilder::InitializeWithProfile(Profile* profile, void AppListModelBuilder::InsertApp(scoped_ptr<app_list::AppListItem> app) { if (service_) { - service_->AddItem(app.Pass()); + service_->AddItem(std::move(app)); return; } - model_->AddItem(app.Pass()); + model_->AddItem(std::move(app)); } const app_list::AppListSyncableService::SyncItem* diff --git a/chrome/browser/ui/app_list/app_list_prefs.cc b/chrome/browser/ui/app_list/app_list_prefs.cc index e4c37de..ca28bfa 100644 --- a/chrome/browser/ui/app_list/app_list_prefs.cc +++ b/chrome/browser/ui/app_list/app_list_prefs.cc @@ -37,7 +37,7 @@ AppListPrefs::AppListInfo::CreateDictFromAppListInfo() const { item_dict->SetString(kModelItemParentId, parent_id); item_dict->SetString(kModelItemName, name); item_dict->SetInteger(kModelItemType, item_type); - return item_dict.Pass(); + return item_dict; } // static @@ -58,7 +58,7 @@ AppListPrefs::AppListInfo::CreateAppListInfoFromDict( info->position = syncer::StringOrdinal(item_ordinal_string); info->item_type = static_cast<ItemType>(item_type_int); - return info.Pass(); + return info; } // AppListPrefs diff --git a/chrome/browser/ui/app_list/app_list_prefs_factory.cc b/chrome/browser/ui/app_list/app_list_prefs_factory.cc index ddb0f9a..b9818ee 100644 --- a/chrome/browser/ui/app_list/app_list_prefs_factory.cc +++ b/chrome/browser/ui/app_list/app_list_prefs_factory.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/app_list_prefs_factory.h" +#include <utility> + #include "base/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/app_list/app_list_prefs.h" @@ -28,7 +30,7 @@ AppListPrefsFactory* AppListPrefsFactory::GetInstance() { void AppListPrefsFactory::SetInstanceForTesting( content::BrowserContext* context, scoped_ptr<AppListPrefs> prefs) { - Associate(context, prefs.Pass()); + Associate(context, std::move(prefs)); } AppListPrefsFactory::AppListPrefsFactory() diff --git a/chrome/browser/ui/app_list/app_list_service_impl.cc b/chrome/browser/ui/app_list/app_list_service_impl.cc index 8111ed0..edd5046 100644 --- a/chrome/browser/ui/app_list/app_list_service_impl.cc +++ b/chrome/browser/ui/app_list/app_list_service_impl.cc @@ -6,8 +6,8 @@ #include <stddef.h> #include <stdint.h> - #include <string> +#include <utility> #include "base/bind.h" #include "base/command_line.h" @@ -281,7 +281,7 @@ AppListServiceImpl::AppListServiceImpl() AppListServiceImpl::AppListServiceImpl(const base::CommandLine& command_line, PrefService* local_state, scoped_ptr<ProfileStore> profile_store) - : profile_store_(profile_store.Pass()), + : profile_store_(std::move(profile_store)), command_line_(command_line), local_state_(local_state), profile_loader_(new ProfileLoader(profile_store_.get())), diff --git a/chrome/browser/ui/app_list/app_list_service_unittest.cc b/chrome/browser/ui/app_list/app_list_service_unittest.cc index c1768b1..72f0e2b 100644 --- a/chrome/browser/ui/app_list/app_list_service_unittest.cc +++ b/chrome/browser/ui/app_list/app_list_service_unittest.cc @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/app_list/app_list_service.h" + +#include <utility> + #include "base/command_line.h" #include "base/files/file_path.h" #include "base/macros.h" @@ -12,7 +16,6 @@ #include "base/prefs/testing_pref_store.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profiles_state.h" -#include "chrome/browser/ui/app_list/app_list_service.h" #include "chrome/browser/ui/app_list/app_list_service_impl.h" #include "chrome/browser/ui/app_list/test/fake_profile.h" #include "chrome/browser/ui/app_list/test/fake_profile_store.h" @@ -26,7 +29,7 @@ class TestingAppListServiceImpl : public AppListServiceImpl { TestingAppListServiceImpl(const base::CommandLine& command_line, PrefService* local_state, scoped_ptr<ProfileStore> profile_store) - : AppListServiceImpl(command_line, local_state, profile_store.Pass()), + : AppListServiceImpl(command_line, local_state, std::move(profile_store)), showing_for_profile_(NULL), destroy_app_list_call_count_(0) {} @@ -99,7 +102,7 @@ class AppListServiceUnitTest : public testing::Test { base::PrefServiceFactory factory; factory.set_user_prefs(make_scoped_refptr(new TestingPrefStore)); - local_state_ = factory.Create(pref_registry).Pass(); + local_state_ = factory.Create(pref_registry); profile_store_ = new FakeProfileStore(user_data_dir_, local_state_.get()); service_.reset(new TestingAppListServiceImpl( diff --git a/chrome/browser/ui/app_list/app_list_service_views.cc b/chrome/browser/ui/app_list/app_list_service_views.cc index 2f1df8a..8ae98e5 100644 --- a/chrome/browser/ui/app_list/app_list_service_views.cc +++ b/chrome/browser/ui/app_list/app_list_service_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/app_list_service_views.h" +#include <utility> + #include "chrome/browser/apps/scoped_keep_alive.h" #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" #include "ui/app_list/app_list_switches.h" @@ -15,8 +17,7 @@ AppListServiceViews::AppListServiceViews( scoped_ptr<AppListControllerDelegate> controller_delegate) : shower_(this), can_dismiss_(true), - controller_delegate_(controller_delegate.Pass()) { -} + controller_delegate_(std::move(controller_delegate)) {} AppListServiceViews::~AppListServiceViews() {} diff --git a/chrome/browser/ui/app_list/app_list_shower_views_unittest.cc b/chrome/browser/ui/app_list/app_list_shower_views_unittest.cc index aa779fb..42c8f0f 100644 --- a/chrome/browser/ui/app_list/app_list_shower_views_unittest.cc +++ b/chrome/browser/ui/app_list/app_list_shower_views_unittest.cc @@ -64,8 +64,8 @@ class AppListShowerUnitTest : public testing::Test, void SetUp() override { shower_.reset(new FakeAppListShower(this)); - profile1_ = CreateProfile("p1").Pass(); - profile2_ = CreateProfile("p2").Pass(); + profile1_ = CreateProfile("p1"); + profile2_ = CreateProfile("p2"); } void TearDown() override {} diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.cc b/chrome/browser/ui/app_list/app_list_syncable_service.cc index d610844..3841be3 100644 --- a/chrome/browser/ui/app_list/app_list_syncable_service.cc +++ b/chrome/browser/ui/app_list/app_list_syncable_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/app_list_syncable_service.h" +#include <utility> + #include "base/command_line.h" #include "base/macros.h" #include "base/strings/string_util.h" @@ -382,7 +384,7 @@ void AppListSyncableService::AddItem(scoped_ptr<AppListItem> app_item) { } VLOG(2) << this << ": AddItem: " << sync_item->ToString() << " Folder: '" << folder_id << "'"; - model_->AddItemToFolder(app_item.Pass(), folder_id); + model_->AddItemToFolder(std::move(app_item), folder_id); } AppListSyncableService::SyncItem* AppListSyncableService::FindOrAddSyncItem( @@ -599,8 +601,8 @@ syncer::SyncMergeResult AppListSyncableService::MergeDataAndStartSyncing( // Ensure the model is built. GetModel(); - sync_processor_ = sync_processor.Pass(); - sync_error_handler_ = error_handler.Pass(); + sync_processor_ = std::move(sync_processor); + sync_error_handler_ = std::move(error_handler); if (switches::IsFolderUIEnabled()) model_->SetFoldersEnabled(true); @@ -937,7 +939,7 @@ std::string AppListSyncableService::FindOrCreateOemFolder() { scoped_ptr<AppListFolderItem> new_folder(new AppListFolderItem( kOemFolderId, AppListFolderItem::FOLDER_TYPE_OEM)); oem_folder = - static_cast<AppListFolderItem*>(model_->AddItem(new_folder.Pass())); + static_cast<AppListFolderItem*>(model_->AddItem(std::move(new_folder))); SyncItem* oem_sync_item = FindSyncItem(kOemFolderId); if (oem_sync_item) { VLOG(1) << "Creating OEM folder from existing sync item: " diff --git a/chrome/browser/ui/app_list/fast_show_pickler.cc b/chrome/browser/ui/app_list/fast_show_pickler.cc index 3dc3cda..6b4b4fb 100644 --- a/chrome/browser/ui/app_list/fast_show_pickler.cc +++ b/chrome/browser/ui/app_list/fast_show_pickler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/app_list/fast_show_pickler.h" #include <stddef.h> +#include <utility> #include "third_party/skia/include/core/SkBitmap.h" #include "ui/app_list/app_list_item.h" @@ -165,7 +166,7 @@ scoped_ptr<AppListItem> FastShowPickler::UnpickleAppListItem( if (!UnpickleImage(it, &icon)) return scoped_ptr<AppListItem>(); result->SetIcon(icon); - return result.Pass(); + return result; } bool FastShowPickler::PickleAppListItem(base::Pickle* pickle, @@ -205,7 +206,7 @@ scoped_ptr<base::Pickle> FastShowPickler::PickleAppListModelForFastShow( return scoped_ptr<base::Pickle>(); } } - return result.Pass(); + return result; } void FastShowPickler::CopyOver(AppListModel* src, AppListModel* dest) { @@ -214,7 +215,7 @@ void FastShowPickler::CopyOver(AppListModel* src, AppListModel* dest) { AppListItem* src_item = src->top_level_item_list()->item_at(i); scoped_ptr<AppListItem> dest_item(new AppListItem(src_item->id())); CopyOverItem(src_item, dest_item.get()); - dest->AddItemToFolder(dest_item.Pass(), src_item->folder_id()); + dest->AddItemToFolder(std::move(dest_item), src_item->folder_id()); } } @@ -232,12 +233,12 @@ scoped_ptr<AppListModel> FastShowPickler::UnpickleAppListModelForFastShow( scoped_ptr<AppListModel> model(new AppListModel); for (int i = 0; i < app_count; ++i) { - scoped_ptr<AppListItem> item(UnpickleAppListItem(&it).Pass()); + scoped_ptr<AppListItem> item(UnpickleAppListItem(&it)); if (!item) return scoped_ptr<AppListModel>(); std::string folder_id = item->folder_id(); - model->AddItemToFolder(item.Pass(), folder_id); + model->AddItemToFolder(std::move(item), folder_id); } - return model.Pass(); + return model; } diff --git a/chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc b/chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc index 2e958fb..6c5a1a5 100644 --- a/chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc +++ b/chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h" +#include <utility> + #include "base/values.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/api/launcher_page.h" @@ -39,7 +41,7 @@ void LauncherPageEventDispatcher::PopSubpage() { void LauncherPageEventDispatcher::DispatchEvent( scoped_ptr<extensions::Event> event) { extensions::EventRouter::Get(profile_) - ->DispatchEventToExtension(extension_id_, event.Pass()); + ->DispatchEventToExtension(extension_id_, std::move(event)); } } // namespace app_list diff --git a/chrome/browser/ui/app_list/search/app_result.cc b/chrome/browser/ui/app_list/search/app_result.cc index 89dbe9c..5073e21 100644 --- a/chrome/browser/ui/app_list/search/app_result.cc +++ b/chrome/browser/ui/app_list/search/app_result.cc @@ -115,7 +115,7 @@ scoped_ptr<SearchResult> AppResult::Duplicate() const { copy->set_title_tags(title_tags()); copy->set_relevance(relevance()); - return copy.Pass(); + return copy; } ui::MenuModel* AppResult::GetContextMenuModel() { diff --git a/chrome/browser/ui/app_list/search/app_search_provider.cc b/chrome/browser/ui/app_list/search/app_search_provider.cc index 4537617..7dbe5c6 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider.cc +++ b/chrome/browser/ui/app_list/search/app_search_provider.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/app_list/search/app_search_provider.h" #include <stddef.h> - #include <string> +#include <utility> #include "base/bind.h" #include "base/location.h" @@ -71,7 +71,7 @@ AppSearchProvider::AppSearchProvider(Profile* profile, list_controller_(list_controller), extension_registry_observer_(this), top_level_item_list_(top_level_item_list), - clock_(clock.Pass()), + clock_(std::move(clock)), update_results_factory_(this) { extension_registry_observer_.Add(ExtensionRegistry::Get(profile_)); RefreshApps(); @@ -130,7 +130,7 @@ void AppSearchProvider::UpdateResults() { } else { result->UpdateFromLastLaunched(clock_->Now(), app->last_launch_time()); } - Add(result.Pass()); + Add(std::move(result)); } } else { for (const App* app : apps_) { @@ -141,7 +141,7 @@ void AppSearchProvider::UpdateResults() { continue; result->UpdateFromMatch(app->indexed_name(), match); - Add(result.Pass()); + Add(std::move(result)); } } diff --git a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc index 3dcb112..511d047 100644 --- a/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc +++ b/chrome/browser/ui/app_list/search/app_search_provider_unittest.cc @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stddef.h> +#include "chrome/browser/ui/app_list/search/app_search_provider.h" +#include <stddef.h> #include <string> +#include <utility> #include "base/macros.h" #include "base/memory/scoped_ptr.h" @@ -14,7 +16,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/ui/app_list/app_list_test_util.h" #include "chrome/browser/ui/app_list/extension_app_model_builder.h" -#include "chrome/browser/ui/app_list/search/app_search_provider.h" #include "chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h" #include "chrome/common/chrome_constants.h" #include "chrome/test/base/testing_profile.h" @@ -52,8 +53,9 @@ class AppSearchProviderTest : public AppListTestBase { controller_.reset(new ::test::TestAppListControllerDelegate); builder_.reset(new ExtensionAppModelBuilder(controller_.get())); builder_->InitializeWithProfile(profile_.get(), model_.get()); - app_search_.reset(new AppSearchProvider( - profile_.get(), nullptr, clock.Pass(), model_->top_level_item_list())); + app_search_.reset(new AppSearchProvider(profile_.get(), nullptr, + std::move(clock), + model_->top_level_item_list())); } std::string RunQuery(const std::string& query) { diff --git a/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc b/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc index 5eb72b96..a1fe706 100644 --- a/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc +++ b/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/search/common/json_response_fetcher.h" +#include <utility> + #include "base/bind.h" #include "base/values.h" #include "components/safe_json/safe_json_parser.h" @@ -61,7 +63,7 @@ void JSONResponseFetcher::OnURLFetchComplete( const net::URLFetcher* source) { CHECK_EQ(fetcher_.get(), source); - scoped_ptr<net::URLFetcher> fetcher(fetcher_.Pass()); + scoped_ptr<net::URLFetcher> fetcher(std::move(fetcher_)); if (!fetcher->GetStatus().is_success() || fetcher->GetResponseCode() != 200) { diff --git a/chrome/browser/ui/app_list/search/common/url_icon_source.cc b/chrome/browser/ui/app_list/search/common/url_icon_source.cc index 0687f88..5169959 100644 --- a/chrome/browser/ui/app_list/search/common/url_icon_source.cc +++ b/chrome/browser/ui/app_list/search/common/url_icon_source.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/app_list/search/common/url_icon_source.h" #include <string> +#include <utility> #include "content/public/browser/browser_thread.h" #include "net/base/load_flags.h" @@ -59,7 +60,7 @@ void UrlIconSource::OnURLFetchComplete( const net::URLFetcher* source) { CHECK_EQ(icon_fetcher_.get(), source); - scoped_ptr<net::URLFetcher> fetcher(icon_fetcher_.Pass()); + scoped_ptr<net::URLFetcher> fetcher(std::move(icon_fetcher_)); if (!fetcher->GetStatus().is_success() || fetcher->GetResponseCode() != 200) { diff --git a/chrome/browser/ui/app_list/search/history_unittest.cc b/chrome/browser/ui/app_list/search/history_unittest.cc index fb7c439..a9537f2 100644 --- a/chrome/browser/ui/app_list/search/history_unittest.cc +++ b/chrome/browser/ui/app_list/search/history_unittest.cc @@ -127,7 +127,7 @@ class SearchHistoryTest : public testing::Test { } size_t GetKnownResults(const std::string& query) { - known_results_ = history()->GetKnownResults(query).Pass(); + known_results_ = history()->GetKnownResults(query); return known_results_->size(); } diff --git a/chrome/browser/ui/app_list/search/people/people_provider.cc b/chrome/browser/ui/app_list/search/people/people_provider.cc index 92d626d..724faf5 100644 --- a/chrome/browser/ui/app_list/search/people/people_provider.cc +++ b/chrome/browser/ui/app_list/search/people/people_provider.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/app_list/search/people/people_provider.h" #include <string> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -155,7 +156,7 @@ void PeopleProvider::StartQuery() { void PeopleProvider::OnPeopleSearchFetched( scoped_ptr<base::DictionaryValue> json) { ProcessPeopleSearchResults(json.get()); - cache_->Put(WebserviceCache::PEOPLE, query_, json.Pass()); + cache_->Put(WebserviceCache::PEOPLE, query_, std::move(json)); if (!people_search_fetched_callback_.is_null()) people_search_fetched_callback_.Run(); @@ -183,7 +184,7 @@ void PeopleProvider::ProcessPeopleSearchResults( if (!result) continue; - Add(result.Pass()); + Add(std::move(result)); } } @@ -193,10 +194,10 @@ scoped_ptr<SearchResult> PeopleProvider::CreateResult( scoped_ptr<Person> person = Person::Create(dict); if (!person) - return result.Pass(); + return result; - result.reset(new PeopleResult(profile_, controller_, person.Pass())); - return result.Pass(); + result.reset(new PeopleResult(profile_, controller_, std::move(person))); + return result; } void PeopleProvider::SetupForTest( diff --git a/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc b/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc index b06e363..d98c1d2 100644 --- a/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc +++ b/chrome/browser/ui/app_list/search/people/people_provider_browsertest.cc @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stddef.h> +#include "chrome/browser/ui/app_list/search/people/people_provider.h" +#include <stddef.h> #include <string> +#include <utility> #include "base/bind.h" #include "base/command_line.h" @@ -13,7 +15,6 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/app_list/search/people/people_provider.h" #include "chrome/browser/ui/app_list/test/test_app_list_controller_delegate.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" @@ -223,7 +224,7 @@ class PeopleProviderTest : public InProcessBrowserTest { response->set_code(net::HTTP_OK); response->set_content(mock_server_response_); - return response.Pass(); + return std::move(response); } void OnSearchResultsFetched() { diff --git a/chrome/browser/ui/app_list/search/people/people_result.cc b/chrome/browser/ui/app_list/search/people/people_result.cc index 2d48013..6166bc0 100644 --- a/chrome/browser/ui/app_list/search/people/people_result.cc +++ b/chrome/browser/ui/app_list/search/people/people_result.cc @@ -5,7 +5,7 @@ #include "chrome/browser/ui/app_list/search/people/people_result.h" #include <stddef.h> - +#include <utility> #include <vector> #include "base/bind.h" @@ -59,7 +59,7 @@ PeopleResult::PeopleResult(Profile* profile, scoped_ptr<Person> person) : profile_(profile), controller_(controller), - person_(person.Pass()), + person_(std::move(person)), weak_factory_(this) { set_id(person_->id); set_title(base::UTF8ToUTF16(person_->display_name)); @@ -112,7 +112,7 @@ void PeopleResult::InvokeAction(int action_index, int event_flags) { scoped_ptr<SearchResult> PeopleResult::Duplicate() const { return scoped_ptr<SearchResult>( - new PeopleResult(profile_, controller_, person_->Duplicate().Pass())); + new PeopleResult(profile_, controller_, person_->Duplicate())); } void PeopleResult::OnIconLoaded() { @@ -167,7 +167,7 @@ void PeopleResult::OpenChat() { // TODO(rkc): Change this once we remove the hangoutsPrivate API. // See crbug.com/306672 extensions::EventRouter::Get(profile_) - ->DispatchEventToExtension(hangouts_extension_id_, event.Pass()); + ->DispatchEventToExtension(hangouts_extension_id_, std::move(event)); content::RecordAction(base::UserMetricsAction("PeopleSearch_OpenChat")); } diff --git a/chrome/browser/ui/app_list/search/people/person.cc b/chrome/browser/ui/app_list/search/people/person.cc index 4c5b3f2..8c1673f 100644 --- a/chrome/browser/ui/app_list/search/people/person.cc +++ b/chrome/browser/ui/app_list/search/people/person.cc @@ -70,7 +70,7 @@ scoped_ptr<Person> Person::Create(const base::DictionaryValue& dict) { if (!dict.GetString(kKeyId, &person->id) || !dict.GetString(kKeyOwnerId, &person->owner_id)) { person.reset(); - return person.Pass(); + return person; } // Interaction rank. @@ -79,7 +79,7 @@ scoped_ptr<Person> Person::Create(const base::DictionaryValue& dict) { !base::StringToDouble( interaction_rank_string, &person->interaction_rank)) { person.reset(); - return person.Pass(); + return person; } person->display_name = GetTargetValue(dict, kKeyNames, kKeyDisplayName); @@ -96,7 +96,7 @@ scoped_ptr<Person> Person::Create(const base::DictionaryValue& dict) { person.reset(); } - return person.Pass(); + return person; } Person::Person() : interaction_rank(0.0) { @@ -108,7 +108,7 @@ Person::~Person() { scoped_ptr<Person> Person::Duplicate() { scoped_ptr<Person> person(new Person()); *person = *this; - return person.Pass(); + return person; } } // namespace app_list diff --git a/chrome/browser/ui/app_list/search/search_controller_factory.cc b/chrome/browser/ui/app_list/search/search_controller_factory.cc index d305df0..f972993 100644 --- a/chrome/browser/ui/app_list/search/search_controller_factory.cc +++ b/chrome/browser/ui/app_list/search/search_controller_factory.cc @@ -119,7 +119,7 @@ scoped_ptr<SearchController> CreateSearchController( } #endif - return controller.Pass(); + return controller; } } // namespace app_list diff --git a/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc index 671fc64..eeeb4f6 100644 --- a/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc +++ b/chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/app_list/search/suggestions/suggestions_search_provider.h" +#include <utility> + #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/browser/favicon/favicon_service_factory.h" @@ -84,7 +86,7 @@ void SuggestionsSearchProvider::OnSuggestionsProfileAvailable( profile_, list_controller_, favicon_service_, suggestions_service_, suggestion)); result->set_relevance(1.0 / (i + 1)); - Add(result.Pass()); + Add(std::move(result)); } } diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc index 72f9f06..63e6556 100644 --- a/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc +++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" #include <string> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -115,7 +116,7 @@ void WebstoreProvider::StartQuery() { void WebstoreProvider::OnWebstoreSearchFetched( scoped_ptr<base::DictionaryValue> json) { ProcessWebstoreSearchResults(json.get()); - cache_->Put(WebserviceCache::WEBSTORE, query_, json.Pass()); + cache_->Put(WebserviceCache::WEBSTORE, query_, std::move(json)); query_pending_ = false; if (!webstore_search_fetched_callback_.is_null()) @@ -151,7 +152,7 @@ void WebstoreProvider::ProcessWebstoreSearchResults( first_result = false; } - Add(result.Pass()); + Add(std::move(result)); } } diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc b/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc index 3ecab31..6a25559 100644 --- a/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc +++ b/chrome/browser/ui/app_list/search/webstore/webstore_provider_browsertest.cc @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <stddef.h> +#include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" +#include <stddef.h> #include <string> +#include <utility> #include "base/bind.h" #include "base/command_line.h" @@ -13,7 +15,6 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h" #include "chrome/browser/ui/app_list/search/webstore/webstore_result.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" @@ -234,7 +235,7 @@ class WebstoreProviderTest : public InProcessBrowserTest { } } - return response.Pass(); + return std::move(response); } void OnSearchResultsFetched() { diff --git a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc b/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc index 5538b29..579728d 100644 --- a/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc +++ b/chrome/browser/ui/app_list/test/fast_show_pickler_unittest.cc @@ -79,17 +79,15 @@ TEST_F(AppListModelPicklerUnitTest, EmptyModel) { TEST_F(AppListModelPicklerUnitTest, OneItem) { AppListModel model; - model.AddItem(make_scoped_ptr(new AppListItem("abc")).Pass()); + model.AddItem(make_scoped_ptr(new AppListItem("abc"))); DoConsistencyChecks(&model); } TEST_F(AppListModelPicklerUnitTest, TwoItems) { AppListModel model; - AppListItem* app1 = - model.AddItem(make_scoped_ptr(new AppListItem("abc")).Pass()); + AppListItem* app1 = model.AddItem(make_scoped_ptr(new AppListItem("abc"))); model.SetItemNameAndShortName(app1, "hello, there", "ht"); - AppListItem* app2 = - model.AddItem(make_scoped_ptr(new AppListItem("abc2")).Pass()); + AppListItem* app2 = model.AddItem(make_scoped_ptr(new AppListItem("abc2"))); model.SetItemNameAndShortName(app2, "hello, there 2", "ht2"); DoConsistencyChecks(&model); @@ -97,12 +95,10 @@ TEST_F(AppListModelPicklerUnitTest, TwoItems) { TEST_F(AppListModelPicklerUnitTest, Images) { AppListModel model; - AppListItem* app1 = - model.AddItem(make_scoped_ptr(new AppListItem("abc")).Pass()); + AppListItem* app1 = model.AddItem(make_scoped_ptr(new AppListItem("abc"))); model.SetItemName(app1, "hello, there"); app1->SetIcon(MakeImage()); - AppListItem* app2 = - model.AddItem(make_scoped_ptr(new AppListItem("abc2")).Pass()); + AppListItem* app2 = model.AddItem(make_scoped_ptr(new AppListItem("abc2"))); model.SetItemName(app2, "hello, there 2"); DoConsistencyChecks(&model); @@ -110,8 +106,7 @@ TEST_F(AppListModelPicklerUnitTest, Images) { TEST_F(AppListModelPicklerUnitTest, EmptyImage) { AppListModel model; - AppListItem* app1 = - model.AddItem(make_scoped_ptr(new AppListItem("abc")).Pass()); + AppListItem* app1 = model.AddItem(make_scoped_ptr(new AppListItem("abc"))); model.SetItemName(app1, "hello, there"); app1->SetIcon(gfx::ImageSkia()); diff --git a/chrome/browser/ui/apps/chrome_app_delegate.cc b/chrome/browser/ui/apps/chrome_app_delegate.cc index 467121a..aebb117 100644 --- a/chrome/browser/ui/apps/chrome_app_delegate.cc +++ b/chrome/browser/ui/apps/chrome_app_delegate.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/apps/chrome_app_delegate.h" +#include <utility> + #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/strings/stringprintf.h" @@ -84,7 +86,7 @@ class OpenURLFromTabBasedOnBrowserDefault public: OpenURLFromTabBasedOnBrowserDefault(scoped_ptr<content::WebContents> source, const content::OpenURLParams& params) - : source_(source.Pass()), params_(params) {} + : source_(std::move(source)), params_(params) {} // Opens a URL when called with the result of if this is the default system // browser or not. @@ -124,7 +126,7 @@ void ChromeAppDelegate::RelinquishKeepAliveAfterTimeout( // ChromeAppDelegate which also resets the ScopedKeepAlive. To avoid this, // move the ScopedKeepAlive out to here and let it fall out of scope. if (chrome_app_delegate.get() && chrome_app_delegate->is_hidden_) - scoped_ptr<ScopedKeepAlive>(chrome_app_delegate->keep_alive_.Pass()); + scoped_ptr<ScopedKeepAlive>(std::move(chrome_app_delegate->keep_alive_)); } class ChromeAppDelegate::NewWindowContentsDelegate @@ -155,7 +157,7 @@ ChromeAppDelegate::NewWindowContentsDelegate::OpenURLFromTab( scoped_refptr<ShellIntegration::DefaultWebClientWorker> check_if_default_browser_worker = new ShellIntegration::DefaultBrowserWorker( - new OpenURLFromTabBasedOnBrowserDefault(owned_source.Pass(), + new OpenURLFromTabBasedOnBrowserDefault(std::move(owned_source), params)); // Object lifetime notes: The OpenURLFromTabBasedOnBrowserDefault is owned // by check_if_default_browser_worker. StartCheckIsDefault() takes lifetime @@ -169,7 +171,7 @@ ChromeAppDelegate::NewWindowContentsDelegate::OpenURLFromTab( ChromeAppDelegate::ChromeAppDelegate(scoped_ptr<ScopedKeepAlive> keep_alive) : has_been_shown_(false), is_hidden_(true), - keep_alive_(keep_alive.Pass()), + keep_alive_(std::move(keep_alive)), new_window_contents_delegate_(new NewWindowContentsDelegate()), weak_factory_(this) { registrar_.Add(this, diff --git a/chrome/browser/ui/ash/ash_init.cc b/chrome/browser/ui/ash/ash_init.cc index 35535bf..25378c5 100644 --- a/chrome/browser/ui/ash/ash_init.cc +++ b/chrome/browser/ui/ash/ash_init.cc @@ -68,7 +68,7 @@ void OpenAsh(gfx::AcceleratedWidget remote_window) { ash::Shell* shell = ash::Shell::CreateInstance(shell_init_params); shell->accelerator_controller()->SetScreenshotDelegate( - scoped_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber).Pass()); + scoped_ptr<ash::ScreenshotDelegate>(new ChromeScreenshotGrabber)); #if defined(OS_CHROMEOS) // TODO(flackr): Investigate exposing a blocking pool task runner to chromeos. chromeos::AccelerometerReader::GetInstance()->Initialize( diff --git a/chrome/browser/ui/ash/chrome_keyboard_ui.cc b/chrome/browser/ui/ash/chrome_keyboard_ui.cc index f890e53..18efdce 100644 --- a/chrome/browser/ui/ash/chrome_keyboard_ui.cc +++ b/chrome/browser/ui/ash/chrome_keyboard_ui.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/ash/chrome_keyboard_ui.h" +#include <utility> + #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/shell_window_ids.h" @@ -97,9 +99,9 @@ class AshKeyboardControllerObserver scoped_ptr<extensions::Event> event(new extensions::Event( extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED, virtual_keyboard_private::OnBoundsChanged::kEventName, - event_args.Pass())); + std::move(event_args))); event->restrict_to_browser_context = context_; - router->BroadcastEvent(event.Pass()); + router->BroadcastEvent(std::move(event)); } private: @@ -218,7 +220,8 @@ void ChromeKeyboardUI::SetUpdateInputType(ui::TextInputType type) { scoped_ptr<extensions::Event> event(new extensions::Event( extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, virtual_keyboard_private::OnTextInputBoxFocused::kEventName, - event_args.Pass())); + std::move(event_args))); event->restrict_to_browser_context = browser_context(); - router->DispatchEventToExtension(kVirtualKeyboardExtensionID, event.Pass()); + router->DispatchEventToExtension(kVirtualKeyboardExtensionID, + std::move(event)); } diff --git a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc index d4eb5bc..f891d02 100644 --- a/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc @@ -155,7 +155,7 @@ AppShortcutLauncherItemController::GetApplicationList(int event_flags) { items.push_back(new ChromeLauncherAppMenuItemTab( title, &app_icon, web_contents, i == 0)); } - return items.Pass(); + return items; } std::vector<content::WebContents*> diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc index 2474565..b6f1166 100644 --- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc @@ -180,7 +180,7 @@ ChromeLauncherAppMenuItems AppWindowLauncherItemController::GetApplicationList( index == 0 /* has_leading_separator */)); ++index; } - return items.Pass(); + return items; } ash::ShelfItemDelegate::PerformedAction diff --git a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc index 407e44a..35a724a 100644 --- a/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc +++ b/chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controller.cc @@ -237,7 +237,7 @@ BrowserShortcutLauncherItemController::GetApplicationList(int event_flags) { // enforce the creation of a new browser. if (!found_tabbed_browser) items.clear(); - return items.Pass(); + return items; } ash::ShelfItemDelegate::PerformedAction diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc index c84f9fe1..e76928b 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc @@ -1370,7 +1370,7 @@ ChromeLauncherAppMenuItems ChromeLauncherController::GetApplicationList( // extension itself is a valid application and not a panel. LauncherItemController* controller = GetLauncherItemController(item.id); if (!controller || !GetShelfIDForAppID(controller->app_id())) - return ChromeLauncherAppMenuItems().Pass(); + return ChromeLauncherAppMenuItems(); return controller->GetApplicationList(event_flags); } @@ -2177,7 +2177,7 @@ void ChromeLauncherController::SetShelfItemDelegate( DCHECK(item_delegate); DCHECK(item_delegate_manager_); item_delegate_manager_->SetShelfItemDelegate( - id, scoped_ptr<ash::ShelfItemDelegate>(item_delegate).Pass()); + id, scoped_ptr<ash::ShelfItemDelegate>(item_delegate)); } void ChromeLauncherController::AttachProfile(Profile* profile) { diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc index b5b603f..b06ac6f 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include <stddef.h> - #include <algorithm> #include <string> +#include <utility> #include <vector> #include "ash/ash_switches.h" @@ -249,7 +249,7 @@ class TestV2AppLauncherItemController : public LauncherItemController { new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); items.push_back( new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); - return items.Pass(); + return items; } ui::MenuModel* CreateContextMenu(aura::Window* root_window) override { return NULL; @@ -652,7 +652,7 @@ class ChromeLauncherControllerTest : public BrowserWithTestWindowTest { aura::client::ParentWindowWithContext(window.get(), GetContext(), gfx::Rect(200, 200)); - return new TestBrowserWindowAura(window.Pass()); + return new TestBrowserWindowAura(std::move(window)); } DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerTest); diff --git a/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.cc b/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.cc index 5106b2e..dbc2535 100644 --- a/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.cc +++ b/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" #include <stddef.h> +#include <utility> #include "base/metrics/histogram_macros.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" @@ -21,8 +22,7 @@ const char kSelectedMenuItemIndexHistogramName[] = LauncherApplicationMenuItemModel::LauncherApplicationMenuItemModel( ChromeLauncherAppMenuItems item_list) - : ash::ShelfMenuModel(this), - launcher_items_(item_list.Pass()) { + : ash::ShelfMenuModel(this), launcher_items_(std::move(item_list)) { Build(); } diff --git a/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model_unittest.cc b/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model_unittest.cc index 8825910..9b0a584 100644 --- a/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model_unittest.cc +++ b/chrome/browser/ui/ash/launcher/launcher_application_menu_item_model_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/ash/launcher/launcher_application_menu_item_model.h" +#include <utility> + #include "base/macros.h" #include "base/test/histogram_tester.h" #include "chrome/browser/ui/ash/launcher/test/launcher_application_menu_item_model_test_api.h" @@ -25,7 +27,7 @@ const char kSelectedMenuItemIndexHistogramName[] = TEST(LauncherApplicationMenuItemModelTest, VerifyGetNumMenuItemsEnabledWithNoMenuItems) { ChromeLauncherAppMenuItems menu_items; - LauncherApplicationMenuItemModel menu_model(menu_items.Pass()); + LauncherApplicationMenuItemModel menu_model(std::move(menu_items)); LauncherApplicationMenuItemModelTestAPI menu_model_test_api(&menu_model); EXPECT_EQ(0, menu_model_test_api.GetNumMenuItemsEnabled()); @@ -58,7 +60,7 @@ TEST(LauncherApplicationMenuItemModelTest, menu_items.push_back(enabled_menu_item_2); menu_items.push_back(enabled_menu_item_3); - LauncherApplicationMenuItemModel menu_model(menu_items.Pass()); + LauncherApplicationMenuItemModel menu_model(std::move(menu_items)); LauncherApplicationMenuItemModelTestAPI menu_model_test_api(&menu_model); EXPECT_EQ(3, menu_model_test_api.GetNumMenuItemsEnabled()); @@ -74,7 +76,7 @@ TEST(LauncherApplicationMenuItemModelTest, base::HistogramTester histogram_tester; ChromeLauncherAppMenuItems menu_items; - LauncherApplicationMenuItemModel menu_model(menu_items.Pass()); + LauncherApplicationMenuItemModel menu_model(std::move(menu_items)); LauncherApplicationMenuItemModelTestAPI menu_model_test_api(&menu_model); menu_model_test_api.RecordMenuItemSelectedMetrics(kCommandId, kNumMenuItemsEnabled); @@ -103,7 +105,7 @@ TEST(LauncherApplicationMenuItemModelTest, base::HistogramTester histogram_tester; - LauncherApplicationMenuItemModel menu_model(menu_items.Pass()); + LauncherApplicationMenuItemModel menu_model(std::move(menu_items)); menu_model.ExecuteCommand(kCommandId, kFlags); histogram_tester.ExpectTotalCount(kNumItemsEnabledHistogramName, 1); diff --git a/chrome/browser/ui/ash/multi_user/multi_user_context_menu.cc b/chrome/browser/ui/ash/multi_user/multi_user_context_menu.cc index 9280a1f..2c41f3a 100644 --- a/chrome/browser/ui/ash/multi_user/multi_user_context_menu.cc +++ b/chrome/browser/ui/ash/multi_user/multi_user_context_menu.cc @@ -8,7 +8,7 @@ scoped_ptr<ui::MenuModel> CreateMultiUserContextMenu(aura::Window* window) { scoped_ptr<ui::MenuModel> menu_model; - return menu_model.Pass(); + return menu_model; } void ExecuteVisitDesktopCommand(int command_id, aura::Window* window) {} diff --git a/chrome/browser/ui/ash/window_positioner_unittest.cc b/chrome/browser/ui/ash/window_positioner_unittest.cc index 35e1f2a..b36dd53 100644 --- a/chrome/browser/ui/ash/window_positioner_unittest.cc +++ b/chrome/browser/ui/ash/window_positioner_unittest.cc @@ -4,6 +4,8 @@ #include "ash/wm/window_positioner.h" +#include <utility> + #include "ash/shell.h" #include "ash/test/ash_test_base.h" #include "ash/test/test_shell_delegate.h" @@ -70,13 +72,13 @@ void WindowPositionerTest::SetUp() { Browser::CreateParams window_params(&profile_, chrome::HOST_DESKTOP_TYPE_ASH); browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( - dummy_window.Pass(), &window_params); + std::move(dummy_window), &window_params); // Creating a browser for the popup. Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_, chrome::HOST_DESKTOP_TYPE_ASH); browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( - dummy_popup.Pass(), &popup_params); + std::move(dummy_popup), &popup_params); // We hide all windows upon start - each user is required to set it up // as he needs it. diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc index 5d6bde0..31469f6 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_browsertest.cc @@ -317,7 +317,7 @@ class AutofillDialogControllerTest : public InProcessBrowserTest { } scoped_ptr<AutofillDialogViewTester> GetViewTester() { - return AutofillDialogViewTester::For(controller()->view()).Pass(); + return AutofillDialogViewTester::For(controller()->view()); } TestAutofillDialogController* controller() { return controller_; } diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc index df81dae..fcf97d5 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc @@ -7,6 +7,7 @@ #include <algorithm> #include <map> #include <string> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -1430,9 +1431,8 @@ bool AutofillDialogControllerImpl::HandleKeyPressEventInInput( void AutofillDialogControllerImpl::ShowNewCreditCardBubble( scoped_ptr<CreditCard> new_card, scoped_ptr<AutofillProfile> billing_profile) { - NewCreditCardBubbleController::Show(web_contents(), - new_card.Pass(), - billing_profile.Pass()); + NewCreditCardBubbleController::Show(web_contents(), std::move(new_card), + std::move(billing_profile)); } void AutofillDialogControllerImpl::SubmitButtonDelayBegin() { @@ -2303,7 +2303,8 @@ void AutofillDialogControllerImpl::MaybeShowCreditCardBubble() { billing_profile.reset(new AutofillProfile(*profile)); } - ShowNewCreditCardBubble(newly_saved_card_.Pass(), billing_profile.Pass()); + ShowNewCreditCardBubble(std::move(newly_saved_card_), + std::move(billing_profile)); } void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc index 6ea9484..e39dba5 100644 --- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc @@ -284,8 +284,8 @@ class TestAutofillDialogController void ShowNewCreditCardBubble( scoped_ptr<CreditCard> new_card, scoped_ptr<AutofillProfile> billing_profile) override { - mock_new_card_bubble_controller_->Show(new_card.Pass(), - billing_profile.Pass()); + mock_new_card_bubble_controller_->Show(std::move(new_card), + std::move(billing_profile)); } // AutofillDialogControllerImpl calls this method before showing the dialog diff --git a/chrome/browser/ui/autofill/chrome_autofill_client.cc b/chrome/browser/ui/autofill/chrome_autofill_client.cc index 94a6934..ca159ec 100644 --- a/chrome/browser/ui/autofill/chrome_autofill_client.cc +++ b/chrome/browser/ui/autofill/chrome_autofill_client.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/autofill/chrome_autofill_client.h" +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #include "base/logging.h" @@ -200,7 +202,7 @@ void ChromeAutofillClient::ConfirmSaveCreditCardToCloud( autofill::SaveCardBubbleControllerImpl::CreateForWebContents(web_contents()); autofill::SaveCardBubbleControllerImpl* controller = autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents()); - controller->ShowBubbleForUpload(callback, legal_message.Pass()); + controller->ShowBubbleForUpload(callback, std::move(legal_message)); #endif } diff --git a/chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.cc b/chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.cc index e2dfa87..c36ec99 100644 --- a/chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.cc +++ b/chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/autofill/mock_new_credit_card_bubble_controller.h" +#include <utility> + #include "base/logging.h" #include "components/autofill/core/browser/autofill_profile.h" #include "components/autofill/core/browser/credit_card.h" @@ -21,8 +23,8 @@ void MockNewCreditCardBubbleController::Show( CHECK(new_card); CHECK(billing_profile); - new_card_ = new_card.Pass(); - billing_profile_ = billing_profile.Pass(); + new_card_ = std::move(new_card); + billing_profile_ = std::move(billing_profile); ++bubbles_shown_; } diff --git a/chrome/browser/ui/autofill/new_credit_card_bubble_controller.cc b/chrome/browser/ui/autofill/new_credit_card_bubble_controller.cc index c61ebbb..e768ee1 100644 --- a/chrome/browser/ui/autofill/new_credit_card_bubble_controller.cc +++ b/chrome/browser/ui/autofill/new_credit_card_bubble_controller.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" #include <string> +#include <utility> #include "base/logging.h" #include "base/strings/utf_string_conversions.h" @@ -39,9 +40,8 @@ void NewCreditCardBubbleController::Show( content::WebContents* web_contents, scoped_ptr<CreditCard> new_card, scoped_ptr<AutofillProfile> billing_profile) { - (new NewCreditCardBubbleController(web_contents))->SetupAndShow( - new_card.Pass(), - billing_profile.Pass()); + (new NewCreditCardBubbleController(web_contents)) + ->SetupAndShow(std::move(new_card), std::move(billing_profile)); } const base::string16& NewCreditCardBubbleController::TitleText() const { @@ -92,8 +92,8 @@ void NewCreditCardBubbleController::SetupAndShow( DCHECK(new_card); DCHECK(billing_profile); - new_card_ = new_card.Pass(); - billing_profile_ = billing_profile.Pass(); + new_card_ = std::move(new_card); + billing_profile_ = std::move(billing_profile); const base::string16 card_number = new_card_->GetRawInfo(CREDIT_CARD_NUMBER); diff --git a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc index 7dd9925..b768885 100644 --- a/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc +++ b/chrome/browser/ui/autofill/password_generation_popup_view_browsertest.cc @@ -50,7 +50,7 @@ class PasswordGenerationPopupViewTest : public InProcessBrowserTest { } scoped_ptr<PasswordGenerationPopupViewTester> GetViewTester() { - return PasswordGenerationPopupViewTester::For(controller_->view()).Pass(); + return PasswordGenerationPopupViewTester::For(controller_->view()); } protected: diff --git a/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc b/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc index 5a8658e..2fa5eae 100644 --- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc +++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl_unittest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" #include <stddef.h> +#include <utility> #include "base/json/json_reader.h" #include "base/macros.h" @@ -72,7 +73,7 @@ class SaveCardBubbleControllerImplTest : public BrowserWithTestWindowTest { scoped_ptr<base::DictionaryValue> legal_message = dictionary->CreateDeepCopy(); controller()->ShowBubbleForUpload(base::Bind(&SaveCardCallback), - legal_message.Pass()); + std::move(legal_message)); } // Returns true if lines are the same. diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc index faea768..9b22c96 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc @@ -568,7 +568,7 @@ ScopedVector<ContentSettingImageModel> CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS)); result.push_back(new ContentSettingMIDISysExImageModel()); - return result.Pass(); + return result; } void ContentSettingImageModel::SetIconByResourceId(int id) { diff --git a/chrome/browser/ui/crypto_module_delegate_nss.cc b/chrome/browser/ui/crypto_module_delegate_nss.cc index 1d7672a..2bbbeef 100644 --- a/chrome/browser/ui/crypto_module_delegate_nss.cc +++ b/chrome/browser/ui/crypto_module_delegate_nss.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/crypto_module_delegate_nss.h" +#include <utility> + #include "base/bind.h" #include "chrome/browser/net/nss_context.h" #include "content/public/browser/browser_thread.h" @@ -22,7 +24,7 @@ void CreateWithSlot(chrome::CryptoModulePasswordReason reason, return; } callback.Run(scoped_ptr<ChromeNSSCryptoModuleDelegate>( - new ChromeNSSCryptoModuleDelegate(reason, server, slot.Pass()))); + new ChromeNSSCryptoModuleDelegate(reason, server, std::move(slot)))); } } // namespace @@ -35,8 +37,7 @@ ChromeNSSCryptoModuleDelegate::ChromeNSSCryptoModuleDelegate( server_(server), event_(false, false), cancelled_(false), - slot_(slot.Pass()) { -} + slot_(std::move(slot)) {} ChromeNSSCryptoModuleDelegate::~ChromeNSSCryptoModuleDelegate() {} @@ -56,12 +57,12 @@ void ChromeNSSCryptoModuleDelegate::CreateForResourceContext( crypto::ScopedPK11Slot slot = GetPrivateNSSKeySlotForResourceContext(context, get_slot_callback); if (slot) - get_slot_callback.Run(slot.Pass()); + get_slot_callback.Run(std::move(slot)); } // TODO(mattm): allow choosing which slot to generate and store the key. crypto::ScopedPK11Slot ChromeNSSCryptoModuleDelegate::RequestSlot() { - return slot_.Pass(); + return std::move(slot_); } std::string ChromeNSSCryptoModuleDelegate::RequestPassword( diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.cc b/chrome/browser/ui/extensions/extension_action_view_controller.cc index fbb8ebb..c0a484d 100644 --- a/chrome/browser/ui/extensions/extension_action_view_controller.cc +++ b/chrome/browser/ui/extensions/extension_action_view_controller.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/extensions/extension_action_view_controller.h" +#include <utility> + #include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/extensions/api/commands/command_service.h" @@ -321,12 +323,10 @@ bool ExtensionActionViewController::TriggerPopupWithUrl( toolbar_actions_bar_->PopOutAction( this, base::Bind(&ExtensionActionViewController::ShowPopup, - weak_factory_.GetWeakPtr(), - base::Passed(host.Pass()), - grant_tab_permissions, - show_action)); + weak_factory_.GetWeakPtr(), base::Passed(std::move(host)), + grant_tab_permissions, show_action)); } else { - ShowPopup(host.Pass(), grant_tab_permissions, show_action); + ShowPopup(std::move(host), grant_tab_permissions, show_action); } return true; @@ -340,8 +340,8 @@ void ExtensionActionViewController::ShowPopup( // (since it can open asynchronously). Check before proceeding. if (!popup_host_) return; - platform_delegate_->ShowPopup( - popup_host.Pass(), grant_tab_permissions, show_action); + platform_delegate_->ShowPopup(std::move(popup_host), grant_tab_permissions, + show_action); view_delegate_->OnPopupShown(grant_tab_permissions); } @@ -375,7 +375,7 @@ ExtensionActionViewController::GetIconImageSource( extension_action_->GetBadgeTextColor(tab_id), extension_action_->GetBadgeBackgroundColor(tab_id))); } - image_source->SetBadge(badge.Pass()); + image_source->SetBadge(std::move(badge)); // Greyscaling disabled actions and having a special wants-to-run decoration // are gated on the toolbar redesign. @@ -392,5 +392,5 @@ ExtensionActionViewController::GetIconImageSource( image_source->set_paint_decoration(WantsToRun(web_contents) && is_overflow); } - return image_source.Pass(); + return image_source; } diff --git a/chrome/browser/ui/extensions/extension_installed_bubble.cc b/chrome/browser/ui/extensions/extension_installed_bubble.cc index 7f23cfe..74d65aa 100644 --- a/chrome/browser/ui/extensions/extension_installed_bubble.cc +++ b/chrome/browser/ui/extensions/extension_installed_bubble.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/extensions/extension_installed_bubble.h" #include <string> +#include <utility> #include "base/bind.h" #include "base/macros.h" @@ -47,7 +48,7 @@ class ExtensionInstalledBubbleObserver public: explicit ExtensionInstalledBubbleObserver( scoped_ptr<ExtensionInstalledBubble> bubble) - : bubble_(bubble.Pass()), + : bubble_(std::move(bubble)), extension_registry_observer_(this), animation_wait_retries_(0), weak_factory_(this) { @@ -115,7 +116,7 @@ class ExtensionInstalledBubbleObserver if (bubble_->ShouldShow()) { // Must be 2 lines because the manager will take ownership of bubble. BubbleManager* manager = bubble_->browser()->GetBubbleManager(); - manager->ShowBubble(bubble_.Pass()); + manager->ShowBubble(std::move(bubble_)); delete this; return; } @@ -168,7 +169,7 @@ scoped_ptr<extensions::Command> GetCommand( } if (has_command) result.reset(new extensions::Command(command)); - return result.Pass(); + return result; } } // namespace diff --git a/chrome/browser/ui/extensions/extension_message_bubble_factory.cc b/chrome/browser/ui/extensions/extension_message_bubble_factory.cc index 178193b..c461bce 100644 --- a/chrome/browser/ui/extensions/extension_message_bubble_factory.cc +++ b/chrome/browser/ui/extensions/extension_message_bubble_factory.cc @@ -112,7 +112,7 @@ ExtensionMessageBubbleFactory::GetController() { scoped_ptr<extensions::ExtensionMessageBubbleController> controller; if (g_override_for_testing == OVERRIDE_DISABLED) - return controller.Pass(); + return controller; // The list of suspicious extensions takes priority over the dev mode bubble // and the settings API bubble, since that needs to be shown as soon as we @@ -129,7 +129,7 @@ ExtensionMessageBubbleFactory::GetController() { browser_->profile()), browser_)); if (controller->ShouldShow()) - return controller.Pass(); + return controller; } if (EnableSettingsApiBubble()) { @@ -140,7 +140,7 @@ ExtensionMessageBubbleFactory::GetController() { browser_->profile(), extensions::BUBBLE_TYPE_STARTUP_PAGES), browser_)); if (controller->ShouldShow()) - return controller.Pass(); + return controller; } } @@ -151,7 +151,7 @@ ExtensionMessageBubbleFactory::GetController() { browser_->profile()), browser_)); if (controller->ShouldShow()) - return controller.Pass(); + return controller; } if (EnableDevModeBubble()) { @@ -161,11 +161,11 @@ ExtensionMessageBubbleFactory::GetController() { browser_->profile()), browser_)); if (controller->ShouldShow()) - return controller.Pass(); + return controller; } controller.reset(); - return controller.Pass(); + return controller; } // static diff --git a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc index 6984b3d..014d9f7 100644 --- a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc +++ b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc @@ -6,6 +6,7 @@ #include <algorithm> #include <cmath> +#include <utility> #include "base/logging.h" #include "base/strings/utf_string_conversions.h" @@ -109,7 +110,7 @@ void IconWithBadgeImageSource::SetIcon(const gfx::Image& icon) { } void IconWithBadgeImageSource::SetBadge(scoped_ptr<Badge> badge) { - badge_ = badge.Pass(); + badge_ = std::move(badge); } void IconWithBadgeImageSource::Draw(gfx::Canvas* canvas) { diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc index 2a7cdec..2f71c1e 100644 --- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc +++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" #include <math.h> -#include <set> - #include <pango/pango.h> +#include <set> +#include <utility> #include "base/command_line.h" #include "base/debug/leak_annotations.h" @@ -728,7 +728,7 @@ scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( views::LabelButton* owning_button, scoped_ptr<views::LabelButtonBorder> border) { if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance()) - return border.Pass(); + return std::move(border); scoped_ptr<views::LabelButtonAssetBorder> gtk_border( new views::LabelButtonAssetBorder(owning_button->style())); @@ -782,7 +782,8 @@ scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( gtk_border->SetPainter(paintstate[i].focus, paintstate[i].state, painter); } - return gtk_border.Pass();; + return std::move(gtk_border); + ; } void Gtk2UI::AddWindowButtonOrderObserver( diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc index aa8541a..dcf994c 100644 --- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc +++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc @@ -60,7 +60,7 @@ ScopedVector<const autofill::PasswordForm> DeepCopyForms( [](const autofill::PasswordForm* form) { return new autofill::PasswordForm(*form); }); - return result.Pass(); + return result; } password_bubble_experiment::SmartLockBranding GetSmartLockBrandingState( diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h index e6af1df..d9a6f7a 100644 --- a/chrome/browser/ui/passwords/manage_passwords_bubble_model.h +++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model.h @@ -5,6 +5,8 @@ #ifndef CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ #define CHROME_BROWSER_UI_PASSWORDS_MANAGE_PASSWORDS_BUBBLE_MODEL_H_ +#include <utility> + #include "base/macros.h" #include "base/memory/scoped_vector.h" #include "base/time/clock.h" @@ -142,7 +144,7 @@ class ManagePasswordsBubbleModel : public content::WebContentsObserver { return dismissal_reason_; } - void set_clock(scoped_ptr<base::Clock> clock) { clock_ = clock.Pass(); } + void set_clock(scoped_ptr<base::Clock> clock) { clock_ = std::move(clock); } #endif private: diff --git a/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc index 4d59545..6fceb41 100644 --- a/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" + +#include <utility> #include <vector> #include "base/metrics/field_trial.h" @@ -13,7 +16,6 @@ #include "chrome/browser/password_manager/password_store_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_test_util.h" -#include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" #include "chrome/test/base/testing_profile.h" #include "components/browser_sync/browser/profile_sync_service_mock.h" @@ -254,7 +256,7 @@ TEST_F(ManagePasswordsBubbleModelTest, CloseWithoutInteraction) { scoped_ptr<base::SimpleTestClock> clock(new base::SimpleTestClock); base::Time now = base::Time::Now(); clock->SetNow(now); - model()->set_clock(clock.Pass()); + model()->set_clock(std::move(clock)); password_manager::InteractionsStats stats = GetTestStats(); stats.dismissal_count++; stats.update_time = now; diff --git a/chrome/browser/ui/passwords/manage_passwords_state.cc b/chrome/browser/ui/passwords/manage_passwords_state.cc index 826ed8b..8f2cfcc 100644 --- a/chrome/browser/ui/passwords/manage_passwords_state.cc +++ b/chrome/browser/ui/passwords/manage_passwords_state.cc @@ -46,7 +46,7 @@ ScopedVector<const autofill::PasswordForm> DeepCopyMapToVector( ret.reserve(password_form_map.size()); for (const auto& form_pair : password_form_map) ret.push_back(new autofill::PasswordForm(*form_pair.second)); - return ret.Pass(); + return ret; } ScopedVector<const autofill::PasswordForm> ConstifyVector( @@ -54,7 +54,7 @@ ScopedVector<const autofill::PasswordForm> ConstifyVector( ScopedVector<const autofill::PasswordForm> ret; ret.assign(forms->begin(), forms->end()); forms->weak_clear(); - return ret.Pass(); + return ret; } // Updates one form in |forms| that has the same unique key as |updated_form|. @@ -99,7 +99,7 @@ ManagePasswordsState::~ManagePasswordsState() {} void ManagePasswordsState::OnPendingPassword( scoped_ptr<password_manager::PasswordFormManager> form_manager) { ClearData(); - form_manager_ = form_manager.Pass(); + form_manager_ = std::move(form_manager); current_forms_weak_ = ScopedPtrMapToVector(form_manager_->best_matches()); origin_ = form_manager_->pending_credentials().origin; SetState(password_manager::ui::PENDING_PASSWORD_STATE); @@ -108,7 +108,7 @@ void ManagePasswordsState::OnPendingPassword( void ManagePasswordsState::OnUpdatePassword( scoped_ptr<password_manager::PasswordFormManager> form_manager) { ClearData(); - form_manager_ = form_manager.Pass(); + form_manager_ = std::move(form_manager); current_forms_weak_ = ScopedPtrMapToVector(form_manager_->best_matches()); origin_ = form_manager_->pending_credentials().origin; SetState(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE); diff --git a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc index d1bca52..972fb38 100644 --- a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc @@ -86,11 +86,11 @@ ManagePasswordsStateTest::CreateFormManager() { test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); ScopedVector<autofill::PasswordForm> stored_forms; stored_forms.push_back(new autofill::PasswordForm(test_local_form())); - test_form_manager->OnGetPasswordStoreResults(stored_forms.Pass()); + test_form_manager->OnGetPasswordStoreResults(std::move(stored_forms)); EXPECT_EQ(1u, test_form_manager->best_matches().size()); EXPECT_EQ(test_local_form(), *test_form_manager->best_matches().begin()->second); - return test_form_manager.Pass(); + return test_form_manager; } void ManagePasswordsStateTest::TestNoisyUpdates() { @@ -228,7 +228,7 @@ TEST_F(ManagePasswordsStateTest, PasswordSubmitted) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnPendingPassword(test_form_manager.Pass()); + passwords_data().OnPendingPassword(std::move(test_form_manager)); EXPECT_THAT(passwords_data().GetCurrentForms(), ElementsAre(Pointee(test_local_form()))); @@ -248,7 +248,7 @@ TEST_F(ManagePasswordsStateTest, PasswordSaved) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnPendingPassword(test_form_manager.Pass()); + passwords_data().OnPendingPassword(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, passwords_data().state()); @@ -269,8 +269,8 @@ TEST_F(ManagePasswordsStateTest, OnRequestCredentials) { federated_credentials.push_back( new autofill::PasswordForm(test_federated_form())); const GURL origin = test_local_form().origin; - passwords_data().OnRequestCredentials(local_credentials.Pass(), - federated_credentials.Pass(), origin); + passwords_data().OnRequestCredentials( + std::move(local_credentials), std::move(federated_credentials), origin); passwords_data().set_credentials_callback(base::Bind( &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this))); EXPECT_THAT(passwords_data().GetCurrentForms(), @@ -302,7 +302,7 @@ TEST_F(ManagePasswordsStateTest, OnRequestCredentials) { TEST_F(ManagePasswordsStateTest, AutoSignin) { ScopedVector<autofill::PasswordForm> local_credentials; local_credentials.push_back(new autofill::PasswordForm(test_local_form())); - passwords_data().OnAutoSignin(local_credentials.Pass()); + passwords_data().OnAutoSignin(std::move(local_credentials)); EXPECT_THAT(passwords_data().GetCurrentForms(), ElementsAre(Pointee(test_local_form()))); EXPECT_THAT(passwords_data().federated_credentials_forms(), IsEmpty()); @@ -326,7 +326,7 @@ TEST_F(ManagePasswordsStateTest, AutomaticPasswordSave) { test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnAutomaticPasswordSave(test_form_manager.Pass()); + passwords_data().OnAutomaticPasswordSave(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::CONFIRMATION_STATE, passwords_data().state()); EXPECT_EQ(test_submitted_form().origin, passwords_data().origin()); ASSERT_TRUE(passwords_data().form_manager()); @@ -387,7 +387,7 @@ TEST_F(ManagePasswordsStateTest, OnInactive) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnPendingPassword(test_form_manager.Pass()); + passwords_data().OnPendingPassword(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, passwords_data().state()); passwords_data().OnInactive(); @@ -405,7 +405,7 @@ TEST_F(ManagePasswordsStateTest, PendingPasswordAddBlacklisted) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnPendingPassword(test_form_manager.Pass()); + passwords_data().OnPendingPassword(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, passwords_data().state()); @@ -419,8 +419,8 @@ TEST_F(ManagePasswordsStateTest, RequestCredentialsAddBlacklisted) { federated_credentials.push_back( new autofill::PasswordForm(test_federated_form())); const GURL origin = test_local_form().origin; - passwords_data().OnRequestCredentials(local_credentials.Pass(), - federated_credentials.Pass(), origin); + passwords_data().OnRequestCredentials( + std::move(local_credentials), std::move(federated_credentials), origin); passwords_data().set_credentials_callback(base::Bind( &ManagePasswordsStateTest::CredentialCallback, base::Unretained(this))); EXPECT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE, @@ -432,7 +432,7 @@ TEST_F(ManagePasswordsStateTest, RequestCredentialsAddBlacklisted) { TEST_F(ManagePasswordsStateTest, AutoSigninAddBlacklisted) { ScopedVector<autofill::PasswordForm> local_credentials; local_credentials.push_back(new autofill::PasswordForm(test_local_form())); - passwords_data().OnAutoSignin(local_credentials.Pass()); + passwords_data().OnAutoSignin(std::move(local_credentials)); EXPECT_EQ(password_manager::ui::AUTO_SIGNIN_STATE, passwords_data().state()); TestBlacklistedUpdates(); @@ -444,7 +444,7 @@ TEST_F(ManagePasswordsStateTest, AutomaticPasswordSaveAddBlacklisted) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnAutomaticPasswordSave(test_form_manager.Pass()); + passwords_data().OnAutomaticPasswordSave(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::CONFIRMATION_STATE, passwords_data().state()); TestBlacklistedUpdates(); @@ -468,7 +468,7 @@ TEST_F(ManagePasswordsStateTest, PasswordUpdateAddBlacklisted) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnUpdatePassword(test_form_manager.Pass()); + passwords_data().OnUpdatePassword(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, passwords_data().state()); @@ -481,7 +481,7 @@ TEST_F(ManagePasswordsStateTest, PasswordUpdateSubmitted) { test_form_manager->ProvisionallySave( test_submitted_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - passwords_data().OnUpdatePassword(test_form_manager.Pass()); + passwords_data().OnUpdatePassword(std::move(test_form_manager)); EXPECT_THAT(passwords_data().GetCurrentForms(), ElementsAre(Pointee(test_local_form()))); diff --git a/chrome/browser/ui/passwords/manage_passwords_test.cc b/chrome/browser/ui/passwords/manage_passwords_test.cc index 9d32abda..b3dfb7b 100644 --- a/chrome/browser/ui/passwords/manage_passwords_test.cc +++ b/chrome/browser/ui/passwords/manage_passwords_test.cc @@ -63,8 +63,8 @@ void ManagePasswordsTest::SetupPendingPassword() { nullptr, &client, driver.AsWeakPtr(), *test_form(), false)); test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); ScopedVector<autofill::PasswordForm> best_matches; - test_form_manager->OnGetPasswordStoreResults(best_matches.Pass()); - GetController()->OnPasswordSubmitted(test_form_manager.Pass()); + test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); + GetController()->OnPasswordSubmitted(std::move(test_form_manager)); } void ManagePasswordsTest::SetupAutomaticPassword() { @@ -75,7 +75,7 @@ void ManagePasswordsTest::SetupAutomaticPassword() { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( new password_manager::PasswordFormManager( nullptr, &client, driver.AsWeakPtr(), *test_form(), false)); - GetController()->OnAutomaticPasswordSave(test_form_manager.Pass()); + GetController()->OnAutomaticPasswordSave(std::move(test_form_manager)); } void ManagePasswordsTest::SetupChooseCredentials( @@ -88,20 +88,20 @@ void ManagePasswordsTest::SetupChooseCredentials( kTestUsername, make_scoped_ptr(new autofill::PasswordForm(*test_form())))); GetController()->OnChooseCredentials( - local_credentials.Pass(), federated_credentials.Pass(), origin, + std::move(local_credentials), std::move(federated_credentials), origin, base::Bind(&ManagePasswordsTest::OnChooseCredential, this)); } void ManagePasswordsTest::SetupAutoSignin( ScopedVector<autofill::PasswordForm> local_credentials) { - GetController()->OnAutoSignin(local_credentials.Pass()); + GetController()->OnAutoSignin(std::move(local_credentials)); } scoped_ptr<base::HistogramSamples> ManagePasswordsTest::GetSamples( const char* histogram) { // Ensure that everything has been properly recorded before pulling samples. content::RunAllPendingInMessageLoop(); - return histogram_tester_.GetHistogramSamplesSinceCreation(histogram).Pass(); + return histogram_tester_.GetHistogramSamplesSinceCreation(histogram); } PasswordsClientUIDelegate* ManagePasswordsTest::GetController() { diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc index 2596882..32e008b 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" +#include <utility> + #include "base/auto_reset.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browsing_data/browsing_data_helper.h" @@ -66,7 +68,7 @@ ManagePasswordsUIController::~ManagePasswordsUIController() {} void ManagePasswordsUIController::OnPasswordSubmitted( scoped_ptr<PasswordFormManager> form_manager) { bool show_bubble = !form_manager->IsBlacklisted(); - passwords_data_.OnPendingPassword(form_manager.Pass()); + passwords_data_.OnPendingPassword(std::move(form_manager)); if (show_bubble) { password_manager::InteractionsStats* stats = GetCurrentInteractionStats(); const int show_threshold = @@ -80,7 +82,7 @@ void ManagePasswordsUIController::OnPasswordSubmitted( void ManagePasswordsUIController::OnUpdatePasswordSubmitted( scoped_ptr<PasswordFormManager> form_manager) { - passwords_data_.OnUpdatePassword(form_manager.Pass()); + passwords_data_.OnUpdatePassword(std::move(form_manager)); base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); UpdateBubbleAndIconVisibility(); } @@ -91,9 +93,8 @@ bool ManagePasswordsUIController::OnChooseCredentials( const GURL& origin, base::Callback<void(const password_manager::CredentialInfo&)> callback) { DCHECK(!local_credentials.empty() || !federated_credentials.empty()); - passwords_data_.OnRequestCredentials(local_credentials.Pass(), - federated_credentials.Pass(), - origin); + passwords_data_.OnRequestCredentials( + std::move(local_credentials), std::move(federated_credentials), origin); base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); UpdateBubbleAndIconVisibility(); if (!should_pop_up_bubble_) { @@ -107,14 +108,14 @@ bool ManagePasswordsUIController::OnChooseCredentials( void ManagePasswordsUIController::OnAutoSignin( ScopedVector<autofill::PasswordForm> local_forms) { DCHECK(!local_forms.empty()); - passwords_data_.OnAutoSignin(local_forms.Pass()); + passwords_data_.OnAutoSignin(std::move(local_forms)); base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); UpdateBubbleAndIconVisibility(); } void ManagePasswordsUIController::OnAutomaticPasswordSave( scoped_ptr<PasswordFormManager> form_manager) { - passwords_data_.OnAutomaticPasswordSave(form_manager.Pass()); + passwords_data_.OnAutomaticPasswordSave(std::move(form_manager)); base::AutoReset<bool> resetter(&should_pop_up_bubble_, true); UpdateBubbleAndIconVisibility(); } diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc index d908ddb..b2abe94 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc @@ -211,8 +211,8 @@ ManagePasswordsUIControllerTest::CreateFormManagerWithBestMatches( driver_.AsWeakPtr(), observed_form, true)); test_form_manager->SimulateFetchMatchingLoginsFromPasswordStore(); - test_form_manager->OnGetPasswordStoreResults(best_matches.Pass()); - return test_form_manager.Pass(); + test_form_manager->OnGetPasswordStoreResults(std::move(best_matches)); + return test_form_manager; } scoped_ptr<password_manager::PasswordFormManager> @@ -220,7 +220,7 @@ ManagePasswordsUIControllerTest::CreateFormManager() { ScopedVector<autofill::PasswordForm> stored_forms; stored_forms.push_back(new autofill::PasswordForm(test_local_form())); return CreateFormManagerWithBestMatches(test_local_form(), - stored_forms.Pass()); + std::move(stored_forms)); } TEST_F(ManagePasswordsUIControllerTest, DefaultState) { @@ -256,7 +256,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordSubmitted) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, controller()->GetState()); EXPECT_TRUE(controller()->opened_bubble()); @@ -273,9 +273,10 @@ TEST_F(ManagePasswordsUIControllerTest, BlacklistedFormPasswordSubmitted) { ScopedVector<autofill::PasswordForm> stored_forms; stored_forms.push_back(new autofill::PasswordForm(blacklisted)); scoped_ptr<password_manager::PasswordFormManager> test_form_manager = - CreateFormManagerWithBestMatches(test_local_form(), stored_forms.Pass()); + CreateFormManagerWithBestMatches(test_local_form(), + std::move(stored_forms)); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, controller()->GetState()); EXPECT_FALSE(controller()->opened_bubble()); @@ -299,7 +300,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordSubmittedBubbleSuppressed) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, controller()->GetState()); EXPECT_FALSE(controller()->opened_bubble()); @@ -326,7 +327,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordSubmittedBubbleNotSuppressed) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_STATE, controller()->GetState()); EXPECT_TRUE(controller()->opened_bubble()); @@ -342,7 +343,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordSaved) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); controller()->SavePassword(); ExpectIconStateIs(password_manager::ui::MANAGE_STATE); @@ -354,7 +355,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordBlacklisted) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); controller()->NeverSavePassword(); ExpectIconStateIs(password_manager::ui::PENDING_PASSWORD_STATE); @@ -363,7 +364,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordBlacklisted) { TEST_F(ManagePasswordsUIControllerTest, RedirectNavigations) { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( CreateFormManager()); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); ExpectIconStateIs(password_manager::ui::PENDING_PASSWORD_STATE); // Fake-redirect. We expect the bubble's state to persist so a user reasonably @@ -379,7 +380,7 @@ TEST_F(ManagePasswordsUIControllerTest, RedirectNavigations) { TEST_F(ManagePasswordsUIControllerTest, NormalNavigations) { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( CreateFormManager()); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); ExpectIconStateIs(password_manager::ui::PENDING_PASSWORD_STATE); // Fake-navigate. We expect the bubble's state to be reset. @@ -399,7 +400,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordSubmittedToNonWebbyURL) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnPasswordSubmitted(test_form_manager.Pass()); + controller()->OnPasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::INACTIVE_STATE, controller()->GetState()); EXPECT_EQ(GURL::EmptyGURL(), controller()->GetOrigin()); @@ -430,7 +431,7 @@ TEST_F(ManagePasswordsUIControllerTest, AutomaticPasswordSave) { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( CreateFormManager()); - controller()->OnAutomaticPasswordSave(test_form_manager.Pass()); + controller()->OnAutomaticPasswordSave(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::CONFIRMATION_STATE, controller()->GetState()); controller()->OnBubbleHidden(); @@ -443,7 +444,7 @@ TEST_F(ManagePasswordsUIControllerTest, ChooseCredentialLocal) { ScopedVector<autofill::PasswordForm> federated_credentials; GURL origin("http://example.com"); EXPECT_TRUE(controller()->OnChooseCredentials( - local_credentials.Pass(), federated_credentials.Pass(), origin, + std::move(local_credentials), std::move(federated_credentials), origin, base::Bind(&ManagePasswordsUIControllerTest::CredentialCallback, base::Unretained(this)))); EXPECT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE, @@ -474,7 +475,7 @@ TEST_F(ManagePasswordsUIControllerTest, ChooseCredentialLocalButFederated) { ScopedVector<autofill::PasswordForm> federated_credentials; GURL origin("http://example.com"); EXPECT_TRUE(controller()->OnChooseCredentials( - local_credentials.Pass(), federated_credentials.Pass(), origin, + std::move(local_credentials), std::move(federated_credentials), origin, base::Bind(&ManagePasswordsUIControllerTest::CredentialCallback, base::Unretained(this)))); EXPECT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE, @@ -506,7 +507,7 @@ TEST_F(ManagePasswordsUIControllerTest, ChooseCredentialFederated) { new autofill::PasswordForm(test_local_form())); GURL origin("http://example.com"); EXPECT_TRUE(controller()->OnChooseCredentials( - local_credentials.Pass(), federated_credentials.Pass(), origin, + std::move(local_credentials), std::move(federated_credentials), origin, base::Bind(&ManagePasswordsUIControllerTest::CredentialCallback, base::Unretained(this)))); EXPECT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE, @@ -534,7 +535,7 @@ TEST_F(ManagePasswordsUIControllerTest, ChooseCredentialCancel) { ScopedVector<autofill::PasswordForm> federated_credentials; GURL origin("http://example.com"); EXPECT_TRUE(controller()->OnChooseCredentials( - local_credentials.Pass(), federated_credentials.Pass(), origin, + std::move(local_credentials), std::move(federated_credentials), origin, base::Bind(&ManagePasswordsUIControllerTest::CredentialCallback, base::Unretained(this)))); EXPECT_EQ(password_manager::ui::CREDENTIAL_REQUEST_STATE, @@ -555,7 +556,7 @@ TEST_F(ManagePasswordsUIControllerTest, ChooseCredentialCancel) { TEST_F(ManagePasswordsUIControllerTest, AutoSignin) { ScopedVector<autofill::PasswordForm> local_credentials; local_credentials.push_back(new autofill::PasswordForm(test_local_form())); - controller()->OnAutoSignin(local_credentials.Pass()); + controller()->OnAutoSignin(std::move(local_credentials)); EXPECT_EQ(password_manager::ui::AUTO_SIGNIN_STATE, controller()->GetState()); EXPECT_EQ(test_local_form().origin, controller()->GetOrigin()); ASSERT_FALSE(controller()->GetCurrentForms().empty()); @@ -568,7 +569,7 @@ TEST_F(ManagePasswordsUIControllerTest, AutoSignin) { TEST_F(ManagePasswordsUIControllerTest, AutofillDuringAutoSignin) { ScopedVector<autofill::PasswordForm> local_credentials; local_credentials.push_back(new autofill::PasswordForm(test_local_form())); - controller()->OnAutoSignin(local_credentials.Pass()); + controller()->OnAutoSignin(std::move(local_credentials)); ExpectIconAndControllerStateIs(password_manager::ui::AUTO_SIGNIN_STATE); scoped_ptr<autofill::PasswordForm> test_form( new autofill::PasswordForm(test_local_form())); @@ -595,7 +596,7 @@ TEST_F(ManagePasswordsUIControllerTest, InactiveOnPSLMatched) { TEST_F(ManagePasswordsUIControllerTest, UpdatePasswordSubmitted) { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( CreateFormManager()); - controller()->OnUpdatePasswordSubmitted(test_form_manager.Pass()); + controller()->OnUpdatePasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, controller()->GetState()); @@ -608,7 +609,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordUpdated) { test_form_manager->ProvisionallySave( test_local_form(), password_manager::PasswordFormManager::IGNORE_OTHER_POSSIBLE_USERNAMES); - controller()->OnUpdatePasswordSubmitted(test_form_manager.Pass()); + controller()->OnUpdatePasswordSubmitted(std::move(test_form_manager)); ExpectIconStateIs(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE); controller()->UpdatePassword(autofill::PasswordForm()); @@ -618,7 +619,7 @@ TEST_F(ManagePasswordsUIControllerTest, PasswordUpdated) { TEST_F(ManagePasswordsUIControllerTest, NavigationWhenUpdateBubbleActive) { scoped_ptr<password_manager::PasswordFormManager> test_form_manager( CreateFormManager()); - controller()->OnUpdatePasswordSubmitted(test_form_manager.Pass()); + controller()->OnUpdatePasswordSubmitted(std::move(test_form_manager)); EXPECT_EQ(password_manager::ui::PENDING_PASSWORD_UPDATE_STATE, controller()->GetState()); controller()->DidNavigateMainFrame(content::LoadCommittedDetails(), diff --git a/chrome/browser/ui/passwords/password_manager_presenter.cc b/chrome/browser/ui/passwords/password_manager_presenter.cc index 30bcbe6..5441f21 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter.cc +++ b/chrome/browser/ui/passwords/password_manager_presenter.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/passwords/password_manager_presenter.h" +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #include "base/metrics/user_metrics_action.h" @@ -243,7 +245,7 @@ void PasswordManagerPresenter::PasswordListPopulater::Populate() { void PasswordManagerPresenter::PasswordListPopulater::OnGetPasswordStoreResults( ScopedVector<autofill::PasswordForm> results) { page_->password_list_ = - password_manager_util::ConvertScopedVector(results.Pass()); + password_manager_util::ConvertScopedVector(std::move(results)); page_->SetPasswordList(); } @@ -265,6 +267,6 @@ void PasswordManagerPresenter::PasswordExceptionListPopulater::Populate() { void PasswordManagerPresenter::PasswordExceptionListPopulater:: OnGetPasswordStoreResults(ScopedVector<autofill::PasswordForm> results) { page_->password_exception_list_ = - password_manager_util::ConvertScopedVector(results.Pass()); + password_manager_util::ConvertScopedVector(std::move(results)); page_->SetPasswordExceptionList(); } diff --git a/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc b/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc index 430de7cc4..e8a8207 100644 --- a/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc +++ b/chrome/browser/ui/passwords/password_manager_presenter_unittest.cc @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/passwords/password_manager_presenter.h" + #include <stddef.h> +#include <utility> #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/browser/password_manager/password_store_factory.h" -#include "chrome/browser/ui/passwords/password_manager_presenter.h" #include "chrome/browser/ui/passwords/password_ui_view.h" #include "chrome/test/base/testing_profile.h" #include "components/password_manager/core/browser/mock_password_store.h" @@ -93,14 +95,14 @@ void PasswordManagerPresenterTest::AddPasswordEntry( form->password_element = base::ASCIIToUTF16("Passwd"); form->password_value = base::ASCIIToUTF16(password); mock_controller_->GetPasswordManagerPresenter()->password_list_.push_back( - form.Pass()); + std::move(form)); } void PasswordManagerPresenterTest::AddPasswordException(const GURL& origin) { scoped_ptr<autofill::PasswordForm> form(new autofill::PasswordForm()); form->origin = origin; mock_controller_->GetPasswordManagerPresenter() - ->password_exception_list_.push_back(form.Pass()); + ->password_exception_list_.push_back(std::move(form)); } void PasswordManagerPresenterTest::UpdateLists() { diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc index 35ca39e..ae8f99a 100644 --- a/chrome/browser/ui/search/instant_controller.cc +++ b/chrome/browser/ui/search/instant_controller.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/search/instant_controller.h" #include <stddef.h> +#include <utility> #include "base/prefs/pref_service.h" #include "base/strings/stringprintf.h" @@ -63,7 +64,7 @@ void EnsureSearchTermsAreSet(content::WebContents* contents, std::string(), contents->GetBrowserContext()); transient->SetExtraData(sessions::kSearchTermsKey, search_terms); - controller->SetTransientEntry(transient.Pass()); + controller->SetTransientEntry(std::move(transient)); SearchTabHelper::FromWebContents(contents)->NavigationEntryUpdated(); } diff --git a/chrome/browser/ui/search/new_tab_page_interceptor_service.cc b/chrome/browser/ui/search/new_tab_page_interceptor_service.cc index de5964e..776c782 100644 --- a/chrome/browser/ui/search/new_tab_page_interceptor_service.cc +++ b/chrome/browser/ui/search/new_tab_page_interceptor_service.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/search/new_tab_page_interceptor_service.h" +#include <utility> + #include "base/location.h" #include "base/logging.h" #include "base/macros.h" @@ -120,5 +122,5 @@ NewTabPageInterceptorService::CreateInterceptor() { scoped_ptr<NewTabPageInterceptor> interceptor( new NewTabPageInterceptor(search::GetNewTabPageURL(profile_))); interceptor_ = interceptor->GetWeakPtr(); - return interceptor.Pass(); + return std::move(interceptor); } diff --git a/chrome/browser/ui/search/search_ipc_router.cc b/chrome/browser/ui/search/search_ipc_router.cc index 18de364..fce368fb 100644 --- a/chrome/browser/ui/search/search_ipc_router.cc +++ b/chrome/browser/ui/search/search_ipc_router.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/search/search_ipc_router.h" +#include <utility> + #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search/search.h" #include "chrome/common/render_messages.h" @@ -30,10 +32,11 @@ bool IsProviderValid(const base::string16& provider) { } // namespace SearchIPCRouter::SearchIPCRouter(content::WebContents* web_contents, - Delegate* delegate, scoped_ptr<Policy> policy) + Delegate* delegate, + scoped_ptr<Policy> policy) : WebContentsObserver(web_contents), delegate_(delegate), - policy_(policy.Pass()), + policy_(std::move(policy)), commit_counter_(0), is_active_tab_(false) { DCHECK(web_contents); diff --git a/chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc b/chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc index 090e766..bb9864f 100644 --- a/chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc +++ b/chrome/browser/ui/search_engines/search_engine_tab_helper_browsertest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" + +#include <utility> + #include "base/macros.h" #include "base/strings/stringprintf.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/ui/browser.h" -#include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" @@ -77,7 +80,7 @@ class SearchEngineTabHelperBrowserTest : public InProcessBrowserTest { http_response->set_code(net::HTTP_OK); http_response->set_content(html); http_response->set_content_type("text/html"); - return http_response.Pass(); + return std::move(http_response); } // Starts a test server that serves a page pointing to a opensearch descriptor diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc index 83023af..ed72587 100644 --- a/chrome/browser/ui/search_engines/template_url_table_model.cc +++ b/chrome/browser/ui/search_engines/template_url_table_model.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/search_engines/template_url_table_model.h" +#include <utility> + #include "base/bind.h" #include "base/i18n/rtl.h" #include "base/macros.h" @@ -268,7 +270,7 @@ void TemplateURLTableModel::Add(int index, template_url_service_->Add(turl); scoped_ptr<ModelEntry> entry(new ModelEntry(this, turl)); template_url_service_->AddObserver(this); - AddEntry(index, entry.Pass()); + AddEntry(index, std::move(entry)); } void TemplateURLTableModel::ModifyTemplateURL(int index, @@ -317,7 +319,7 @@ int TemplateURLTableModel::MoveToMainGroup(int index) { scoped_ptr<ModelEntry> current_entry(RemoveEntry(index)); const int new_index = last_search_engine_index_++; - AddEntry(new_index, current_entry.Pass()); + AddEntry(new_index, std::move(current_entry)); return new_index; } @@ -381,7 +383,7 @@ TemplateURLTableModel::RemoveEntry(int index) { --last_other_engine_index_; if (observer_) observer_->OnItemsRemoved(index, 1); - return entry.Pass(); + return entry; } void TemplateURLTableModel::AddEntry(int index, scoped_ptr<ModelEntry> entry) { diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc index f77f608..d3e875c 100644 --- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc @@ -2477,8 +2477,7 @@ TEST_F(TabStripModelTest, TabBlockedState) { reinterpret_cast<gfx::NativeWindow>(0), modal_dialog_manager); modal_dialog_manager->ShowDialogWithManager( reinterpret_cast<gfx::NativeWindow>(0), - scoped_ptr<web_modal::SingleWebContentsDialogManager>( - native_manager).Pass()); + scoped_ptr<web_modal::SingleWebContentsDialogManager>(native_manager)); EXPECT_TRUE(strip_src.IsTabBlocked(1)); // Detach the tab. diff --git a/chrome/browser/ui/tabs/tab_utils.cc b/chrome/browser/ui/tabs/tab_utils.cc index b93a0d4..44c091e 100644 --- a/chrome/browser/ui/tabs/tab_utils.cc +++ b/chrome/browser/ui/tabs/tab_utils.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/tabs/tab_utils.h" +#include <utility> + #include "base/command_line.h" #include "base/strings/string16.h" #include "build/build_config.h" @@ -96,7 +98,7 @@ TabRecordingIndicatorAnimation::Create() { scoped_ptr<TabRecordingIndicatorAnimation> animation( new TabRecordingIndicatorAnimation(parts, interval)); animation->set_continuous(false); - return animation.Pass(); + return animation; } } // namespace @@ -228,7 +230,7 @@ scoped_ptr<gfx::Animation> CreateTabMediaIndicatorFadeAnimation( scoped_ptr<gfx::MultiAnimation> animation( new gfx::MultiAnimation(parts, interval)); animation->set_continuous(false); - return animation.Pass(); + return std::move(animation); } base::string16 AssembleTabTooltipText(const base::string16& title, diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc index acef91b..2d17705 100644 --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" +#include <utility> + #include "base/auto_reset.h" #include "base/location.h" #include "base/profiler/scoped_tracker.h" @@ -391,7 +393,7 @@ void ToolbarActionsBar::CreateActions() { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&ToolbarActionsBar::MaybeShowExtensionBubble, weak_ptr_factory_.GetWeakPtr(), - base::Passed(controller.Pass()))); + base::Passed(std::move(controller)))); } } } @@ -486,7 +488,7 @@ void ToolbarActionsBar::OnAnimationEnded() { // Check if we were waiting for animation to complete to either show a // message bubble, or to show a popup. if (pending_extension_bubble_controller_) { - MaybeShowExtensionBubble(pending_extension_bubble_controller_.Pass()); + MaybeShowExtensionBubble(std::move(pending_extension_bubble_controller_)); } else if (!popped_out_closure_.is_null()) { popped_out_closure_.Run(); popped_out_closure_.Reset(); @@ -572,7 +574,7 @@ void ToolbarActionsBar::MaybeShowExtensionBubble( if (delegate_->IsAnimating()) { // If the toolbar is animating, we can't effectively anchor the bubble, // so wait until animation stops. - pending_extension_bubble_controller_ = controller.Pass(); + pending_extension_bubble_controller_ = std::move(controller); } else if (controller->ShouldShow()) { // We check ShouldShow() above because the affected extensions may have been // removed since the controller was initialized. @@ -584,7 +586,7 @@ void ToolbarActionsBar::MaybeShowExtensionBubble( if (anchor_action) break; } - delegate_->ShowExtensionMessageBubble(controller.Pass(), anchor_action); + delegate_->ShowExtensionMessageBubble(std::move(controller), anchor_action); } } diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model.cc b/chrome/browser/ui/toolbar/toolbar_actions_model.cc index 2145668..d10e0c8 100644 --- a/chrome/browser/ui/toolbar/toolbar_actions_model.cc +++ b/chrome/browser/ui/toolbar/toolbar_actions_model.cc @@ -164,7 +164,7 @@ ScopedVector<ToolbarActionViewController> ToolbarActionsModel::CreateActions( for (const ToolbarItem& item : toolbar_items()) action_list.push_back(CreateActionForItem(browser, bar, item).release()); - return action_list.Pass(); + return action_list; } scoped_ptr<ToolbarActionViewController> @@ -187,15 +187,14 @@ ToolbarActionsModel::CreateActionForItem(Browser* browser, case COMPONENT_ACTION: { DCHECK(use_redesign_); result = ComponentToolbarActionsFactory::GetInstance() - ->GetComponentToolbarActionForId(item.id, browser, bar) - .Pass(); + ->GetComponentToolbarActionForId(item.id, browser, bar); break; } case UNKNOWN_ACTION: NOTREACHED(); // Should never have an UNKNOWN_ACTION in toolbar_items. break; } - return result.Pass(); + return result; } void ToolbarActionsModel::OnExtensionActionVisibilityChanged( diff --git a/chrome/browser/ui/translate/translate_bubble_model_impl.cc b/chrome/browser/ui/translate/translate_bubble_model_impl.cc index 20417d0..570d55b 100644 --- a/chrome/browser/ui/translate/translate_bubble_model_impl.cc +++ b/chrome/browser/ui/translate/translate_bubble_model_impl.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/translate/translate_bubble_model_impl.h" +#include <utility> + #include "chrome/browser/translate/chrome_translate_client.h" #include "components/translate/core/browser/language_state.h" #include "components/translate/core/browser/translate_ui_delegate.h" @@ -11,9 +13,8 @@ TranslateBubbleModelImpl::TranslateBubbleModelImpl( translate::TranslateStep step, scoped_ptr<translate::TranslateUIDelegate> ui_delegate) - : ui_delegate_(ui_delegate.Pass()), - view_state_transition_(TranslateStepToViewState(step)) { -} + : ui_delegate_(std::move(ui_delegate)), + view_state_transition_(TranslateStepToViewState(step)) {} TranslateBubbleModelImpl::~TranslateBubbleModelImpl() { } diff --git a/chrome/browser/ui/views/app_list/app_list_dialog_container.cc b/chrome/browser/ui/views/app_list/app_list_dialog_container.cc index 1485005..dd2c4f2 100644 --- a/chrome/browser/ui/views/app_list/app_list_dialog_container.cc +++ b/chrome/browser/ui/views/app_list/app_list_dialog_container.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/app_list/app_list_dialog_container.h" +#include <utility> + #include "base/macros.h" #include "build/build_config.h" #include "chrome/browser/ui/host_desktop.h" @@ -219,7 +221,7 @@ class NativeDialogContainer : public BaseDialogContainer { scoped_ptr<views::BubbleBorder> border(new views::BubbleBorder( views::BubbleBorder::FLOAT, kShadowType, gfx::kPlaceholderColor)); border->set_use_theme_background_color(true); - frame->SetBubbleBorder(border.Pass()); + frame->SetBubbleBorder(std::move(border)); return frame; } diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc index 58d9ea3..10cd6a5 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" #include <stddef.h> +#include <utility> #include "apps/ui/views/app_window_frame_view.h" #include "base/macros.h" @@ -343,7 +344,7 @@ bool ChromeNativeAppWindowViews::IsFullscreenOrPending() const { } void ChromeNativeAppWindowViews::UpdateShape(scoped_ptr<SkRegion> region) { - shape_ = region.Pass(); + shape_ = std::move(region); widget()->SetShape(shape() ? new SkRegion(*shape()) : nullptr); widget()->OnSizeConstraintsChanged(); } diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc index ecb8c70..d956010 100644 --- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc +++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/apps/chrome_native_app_window_views_aura.h" +#include <utility> + #include "apps/ui/views/app_window_frame_view.h" #include "ash/ash_constants.h" #include "ash/frame/custom_frame_view_ash.h" @@ -319,9 +321,8 @@ ChromeNativeAppWindowViewsAura::CreateNonClientFrameView( // Set the delegate now because CustomFrameViewAsh sets the // WindowStateDelegate if one is not already set. ash::wm::GetWindowState(GetNativeWindow()) - ->SetDelegate( - scoped_ptr<ash::wm::WindowStateDelegate>( - new NativeAppWindowStateDelegate(app_window(), this)).Pass()); + ->SetDelegate(scoped_ptr<ash::wm::WindowStateDelegate>( + new NativeAppWindowStateDelegate(app_window(), this))); if (IsFrameless()) return CreateNonStandardAppFrame(); @@ -378,7 +379,7 @@ void ChromeNativeAppWindowViewsAura::SetFullscreen(int fullscreen_types) { void ChromeNativeAppWindowViewsAura::UpdateShape(scoped_ptr<SkRegion> region) { bool had_shape = !!shape(); - ChromeNativeAppWindowViews::UpdateShape(region.Pass()); + ChromeNativeAppWindowViews::UpdateShape(std::move(region)); aura::Window* native_window = widget()->GetNativeWindow(); if (shape() && !had_shape) { diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc index c504740..802b40c 100644 --- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc +++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" +#include <utility> + #include "apps/ui/views/app_window_frame_view.h" #include "base/macros.h" #include "build/build_config.h" @@ -76,7 +78,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) { scoped_ptr<SkRegion> region(new SkRegion); region->op(SkIRect::MakeXYWH(0, 0, 0, 0), SkRegion::kUnion_Op); - app_window()->UpdateShape(region.Pass()); + app_window()->UpdateShape(std::move(region)); { // With an empty custom shape, all events within the window should fall // through to the root window. @@ -101,7 +103,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) { region.reset(new SkRegion); region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op); region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op); - app_window()->UpdateShape(region.Pass()); + app_window()->UpdateShape(std::move(region)); { // With the custom shape, the events that don't fall within the custom shape // will go through to the root window. @@ -159,7 +161,7 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) { scoped_ptr<SkRegion> region(new SkRegion); region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op); region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op); - app_window()->UpdateShape(region.Pass()); + app_window()->UpdateShape(std::move(region)); { // With the custom shape, the events that don't fall within the custom shape // will go through to the root window. diff --git a/chrome/browser/ui/views/autofill/decorated_textfield.cc b/chrome/browser/ui/views/autofill/decorated_textfield.cc index 48bccfd..75435f4 100644 --- a/chrome/browser/ui/views/autofill/decorated_textfield.cc +++ b/chrome/browser/ui/views/autofill/decorated_textfield.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/autofill/decorated_textfield.h" +#include <utility> + #include "chrome/browser/ui/autofill/autofill_dialog_types.h" #include "chrome/browser/ui/views/autofill/tooltip_icon.h" #include "ui/gfx/canvas.h" @@ -162,7 +164,7 @@ void DecoratedTextfield::UpdateBorder() { border->SetInsets(insets.top(), left, insets.bottom(), right); } - SetBorder(border.Pass()); + SetBorder(std::move(border)); } void DecoratedTextfield::IconChanged() { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index 856cd00..b8568d1 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -227,7 +227,7 @@ class BookmarkButtonBase : public views::LabelButton { kButtonPaddingHorizontal, kButtonPaddingVertical, kButtonPaddingHorizontal)); - return border.Pass(); + return border; } bool IsTriggerableEvent(const ui::Event& e) override { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc index c09d3ad..a235875 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" +#include <utility> + #include "base/macros.h" #include "base/strings/string16.h" #include "base/strings/string_util.h" @@ -79,8 +81,8 @@ void BookmarkBubbleView::ShowBubble( return; bookmark_bubble_ = - new BookmarkBubbleView(anchor_view, observer, delegate.Pass(), profile, - url, !already_bookmarked); + new BookmarkBubbleView(anchor_view, observer, std::move(delegate), + profile, url, !already_bookmarked); if (!anchor_view) { bookmark_bubble_->SetAnchorRect(anchor_rect); bookmark_bubble_->set_parent_window(parent_window); @@ -288,7 +290,7 @@ BookmarkBubbleView::BookmarkBubbleView( bool newly_bookmarked) : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), observer_(observer), - delegate_(delegate.Pass()), + delegate_(std::move(delegate)), profile_(profile), url_(url), newly_bookmarked_(newly_bookmarked), diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc index 2353464..9eb155a 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view_unittest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" #include <string> +#include <utility> #include "base/macros.h" #include "base/memory/scoped_ptr.h" @@ -60,11 +61,8 @@ class BookmarkBubbleViewTest : public BrowserWithTestWindowTest { // Creates a bookmark bubble view. void CreateBubbleView() { scoped_ptr<BubbleSyncPromoDelegate> delegate; - bubble_.reset(new BookmarkBubbleView(NULL, - NULL, - delegate.Pass(), - profile(), - GURL(kTestBookmarkURL), + bubble_.reset(new BookmarkBubbleView(NULL, NULL, std::move(delegate), + profile(), GURL(kTestBookmarkURL), true)); } diff --git a/chrome/browser/ui/views/confirm_bubble_views.cc b/chrome/browser/ui/views/confirm_bubble_views.cc index 57a4f33..06d2571 100644 --- a/chrome/browser/ui/views/confirm_bubble_views.cc +++ b/chrome/browser/ui/views/confirm_bubble_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/confirm_bubble_views.h" +#include <utility> + #include "chrome/browser/ui/confirm_bubble.h" #include "chrome/browser/ui/confirm_bubble_model.h" #include "components/constrained_window/constrained_window_views.h" @@ -14,8 +16,7 @@ #include "ui/views/widget/widget.h" ConfirmBubbleViews::ConfirmBubbleViews(scoped_ptr<ConfirmBubbleModel> model) - : model_(model.Pass()), - link_(NULL) { + : model_(std::move(model)), link_(NULL) { views::GridLayout* layout = views::GridLayout::CreatePanel(this); SetLayoutManager(layout); @@ -104,7 +105,8 @@ void ShowConfirmBubble(gfx::NativeWindow window, const gfx::Point& origin, scoped_ptr<ConfirmBubbleModel> model) { constrained_window::CreateBrowserModalDialogViews( - new ConfirmBubbleViews(model.Pass()), window)->Show(); + new ConfirmBubbleViews(std::move(model)), window) + ->Show(); } } // namespace chrome diff --git a/chrome/browser/ui/views/confirm_bubble_views_unittest.cc b/chrome/browser/ui/views/confirm_bubble_views_unittest.cc index cba17e9..206dbef 100644 --- a/chrome/browser/ui/views/confirm_bubble_views_unittest.cc +++ b/chrome/browser/ui/views/confirm_bubble_views_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/confirm_bubble_views.h" +#include <utility> + #include "chrome/browser/ui/confirm_bubble.h" #include "chrome/browser/ui/test/test_confirm_bubble_model.h" #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" @@ -30,7 +32,7 @@ TEST_F(ConfirmBubbleViewsTest, CreateAndClose) { bool model_deleted = false; scoped_ptr<TestConfirmBubbleModel> model( new TestConfirmBubbleModel(&model_deleted, NULL, NULL, NULL)); - ConfirmBubbleViews* bubble = new ConfirmBubbleViews(model.Pass()); + ConfirmBubbleViews* bubble = new ConfirmBubbleViews(std::move(model)); gfx::NativeWindow parent = parent_widget->GetNativeWindow(); constrained_window::CreateBrowserModalDialogViews(bubble, parent)->Show(); diff --git a/chrome/browser/ui/views/constrained_window_views_browsertest.cc b/chrome/browser/ui/views/constrained_window_views_browsertest.cc index 6785969..94398b7 100644 --- a/chrome/browser/ui/views/constrained_window_views_browsertest.cc +++ b/chrome/browser/ui/views/constrained_window_views_browsertest.cc @@ -56,7 +56,7 @@ class TestDialog : public views::DialogDelegateView { scoped_ptr<TestDialog> ShowModalDialog(content::WebContents* web_contents) { scoped_ptr<TestDialog> dialog(new TestDialog()); constrained_window::ShowWebModalDialogViews(dialog.get(), web_contents); - return dialog.Pass(); + return dialog; } } // namespace diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 995eba4..4f64137 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/views/create_application_shortcut_view.h" #include <stddef.h> - #include <algorithm> #include <cmath> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -396,9 +396,9 @@ bool CreateApplicationShortcutView::Accept() { creation_locations.in_quick_launch_bar = false; #endif - web_app::CreateShortcutsWithInfo(web_app::SHORTCUT_CREATION_BY_USER, - creation_locations, shortcut_info_.Pass(), - file_handlers_info_); + web_app::CreateShortcutsWithInfo( + web_app::SHORTCUT_CREATION_BY_USER, creation_locations, + std::move(shortcut_info_), file_handlers_info_); return true; } @@ -558,6 +558,6 @@ bool CreateChromeApplicationShortcutView::Cancel() { void CreateChromeApplicationShortcutView::OnAppInfoLoaded( scoped_ptr<web_app::ShortcutInfo> shortcut_info, const extensions::FileHandlersInfo& file_handlers_info) { - shortcut_info_ = shortcut_info.Pass(); + shortcut_info_ = std::move(shortcut_info); file_handlers_info_ = file_handlers_info; } diff --git a/chrome/browser/ui/views/desktop_media_picker_views.cc b/chrome/browser/ui/views/desktop_media_picker_views.cc index 21e618c..1c89f35 100644 --- a/chrome/browser/ui/views/desktop_media_picker_views.cc +++ b/chrome/browser/ui/views/desktop_media_picker_views.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/desktop_media_picker_views.h" #include <stddef.h> +#include <utility> #include "base/callback.h" #include "base/command_line.h" @@ -210,9 +211,7 @@ void DesktopMediaSourceView::OnGestureEvent(ui::GestureEvent* event) { DesktopMediaListView::DesktopMediaListView( DesktopMediaPickerDialogView* parent, scoped_ptr<DesktopMediaList> media_list) - : parent_(parent), - media_list_(media_list.Pass()), - weak_factory_(this) { + : parent_(parent), media_list_(std::move(media_list)), weak_factory_(this) { media_list_->SetThumbnailSize(gfx::Size(kThumbnailWidth, kThumbnailHeight)); SetFocusable(true); } @@ -398,7 +397,7 @@ DesktopMediaPickerDialogView::DesktopMediaPickerDialogView( app_name_(app_name), label_(new views::Label()), scroll_view_(views::ScrollView::CreateScrollViewWithBorder()), - list_view_(new DesktopMediaListView(this, media_list.Pass())) { + list_view_(new DesktopMediaListView(this, std::move(media_list))) { if (app_name == target_name) { label_->SetText( l10n_util::GetStringFUTF16(IDS_DESKTOP_MEDIA_PICKER_TEXT, app_name)); @@ -587,8 +586,9 @@ void DesktopMediaPickerViews::Show(content::WebContents* web_contents, scoped_ptr<DesktopMediaList> media_list, const DoneCallback& done_callback) { callback_ = done_callback; - dialog_ = new DesktopMediaPickerDialogView( - web_contents, context, this, app_name, target_name, media_list.Pass()); + dialog_ = + new DesktopMediaPickerDialogView(web_contents, context, this, app_name, + target_name, std::move(media_list)); } void DesktopMediaPickerViews::NotifyDialogResult(DesktopMediaID source) { diff --git a/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc b/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc index a5003a2..c2af6c4 100644 --- a/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc +++ b/chrome/browser/ui/views/desktop_media_picker_views_unittest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/ui/views/desktop_media_picker_views.h" + +#include <utility> + #include "base/bind.h" #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media/fake_desktop_media_list.h" -#include "chrome/browser/ui/views/desktop_media_picker_views.h" #include "components/web_modal/test_web_contents_modal_dialog_host.h" #include "content/public/test/test_browser_thread_bundle.h" #include "testing/gmock/include/gmock/gmock.h" @@ -32,12 +35,8 @@ class DesktopMediaPickerViewsTest : public testing::Test { base::string16 app_name = base::ASCIIToUTF16("foo"); picker_views_.reset(new DesktopMediaPickerViews()); - picker_views_->Show(NULL, - test_helper_.GetContext(), - NULL, - app_name, - app_name, - media_list.Pass(), + picker_views_->Show(NULL, test_helper_.GetContext(), NULL, app_name, + app_name, std::move(media_list), base::Bind(&DesktopMediaPickerViewsTest::OnPickerDone, base::Unretained(this))); } diff --git a/chrome/browser/ui/views/elevation_icon_setter.cc b/chrome/browser/ui/views/elevation_icon_setter.cc index a10b8840..1548025 100644 --- a/chrome/browser/ui/views/elevation_icon_setter.cc +++ b/chrome/browser/ui/views/elevation_icon_setter.cc @@ -50,7 +50,7 @@ scoped_ptr<SkBitmap> GetElevationIcon() { gfx::Size(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)))); DestroyIcon(icon_info.hIcon); #endif - return icon.Pass(); + return icon; } } // namespace diff --git a/chrome/browser/ui/views/exclusive_access_bubble_views.cc b/chrome/browser/ui/views/exclusive_access_bubble_views.cc index 64c4113..78721f3c 100644 --- a/chrome/browser/ui/views/exclusive_access_bubble_views.cc +++ b/chrome/browser/ui/views/exclusive_access_bubble_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" +#include <utility> + #include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/strings/string_split.h" @@ -143,7 +145,7 @@ InstructionView::InstructionView(const base::string16& text, // The key name has a border around it. scoped_ptr<views::Border> border(views::Border::CreateRoundedRectBorder( kKeyNameBorderPx, kKeyNameCornerRadius, foreground_color)); - key_name_->SetBorder(border.Pass()); + key_name_->SetBorder(std::move(border)); AddChildView(key_name_); after_key_ = new views::Label(base::string16(), font_list); @@ -252,7 +254,7 @@ ExclusiveAccessBubbleViews::ExclusiveAccessView::ExclusiveAccessView( scoped_ptr<views::BubbleBorder> bubble_border(new views::BubbleBorder( views::BubbleBorder::NONE, shadow_type, background_color)); set_background(new views::BubbleBackground(bubble_border.get())); - SetBorder(bubble_border.Pass()); + SetBorder(std::move(bubble_border)); SetFocusable(false); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); diff --git a/chrome/browser/ui/views/extensions/extension_action_platform_delegate_views.cc b/chrome/browser/ui/views/extensions/extension_action_platform_delegate_views.cc index 27bb3a7..a3d97c0 100644 --- a/chrome/browser/ui/views/extensions/extension_action_platform_delegate_views.cc +++ b/chrome/browser/ui/views/extensions/extension_action_platform_delegate_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/extensions/extension_action_platform_delegate_views.h" +#include <utility> + #include "base/logging.h" #include "chrome/browser/extensions/extension_action.h" #include "chrome/browser/extensions/extension_view_host.h" @@ -82,9 +84,7 @@ void ExtensionActionPlatformDelegateViews::ShowPopup( ExtensionPopup::ShowAction popup_show_action = show_action == ExtensionActionViewController::SHOW_POPUP ? ExtensionPopup::SHOW : ExtensionPopup::SHOW_AND_INSPECT; - ExtensionPopup::ShowPopup(host.Pass(), - reference_view, - arrow, + ExtensionPopup::ShowPopup(std::move(host), reference_view, arrow, popup_show_action); } diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc index d67eb8e..715023c 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" #include <stddef.h> - #include <algorithm> #include <string> +#include <utility> #include <vector> #include "base/command_line.h" @@ -107,11 +107,9 @@ void ShowExtensionInstallDialogImpl( scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); bool use_tab_modal_dialog = prompt->ShouldUseTabModalDialog(); - ExtensionInstallDialogView* dialog = - new ExtensionInstallDialogView(show_params->profile(), - show_params->GetParentWebContents(), - delegate, - prompt.Pass()); + ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( + show_params->profile(), show_params->GetParentWebContents(), delegate, + std::move(prompt)); if (use_tab_modal_dialog) { content::WebContents* parent_web_contents = show_params->GetParentWebContents(); @@ -205,7 +203,7 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( : profile_(profile), navigator_(navigator), delegate_(delegate), - prompt_(prompt.Pass()), + prompt_(std::move(prompt)), container_(NULL), scroll_view_(NULL), handled_result_(false) { diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc index ca0a6f0..7e7513d 100644 --- a/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc +++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view_browsertest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" +#include <utility> + #include "base/macros.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/extensions/extension_browsertest.h" @@ -107,7 +109,7 @@ ExtensionInstallDialogViewTestBase::CreatePrompt() { gfx::Image icon = gfx::Image::CreateFrom1xBitmap(icon_bitmap); prompt->set_icon(icon); - return prompt.Pass(); + return prompt; } class ScrollbarTest : public ExtensionInstallDialogViewTestBase { @@ -129,7 +131,7 @@ ScrollbarTest::ScrollbarTest() bool ScrollbarTest::IsScrollbarVisible( scoped_ptr<ExtensionInstallPrompt::Prompt> prompt) { ExtensionInstallDialogView* dialog = new ExtensionInstallDialogView( - profile(), web_contents(), delegate(), prompt.Pass()); + profile(), web_contents(), delegate(), std::move(prompt)); // Create the modal view around the install dialog view. views::Widget* modal = constrained_window::CreateBrowserModalDialogViews( @@ -153,7 +155,8 @@ IN_PROC_BROWSER_TEST_F(ScrollbarTest, LongPromptScrollbar) { scoped_ptr<ExtensionInstallPrompt::Prompt> prompt = CreatePrompt(); prompt->SetPermissions(permissions, ExtensionInstallPrompt::REGULAR_PERMISSIONS); - ASSERT_TRUE(IsScrollbarVisible(prompt.Pass())) << "Scrollbar is not visible"; + ASSERT_TRUE(IsScrollbarVisible(std::move(prompt))) + << "Scrollbar is not visible"; } // Tests that a scrollbar isn't shown for this regression case. @@ -167,7 +170,7 @@ IN_PROC_BROWSER_TEST_F(ScrollbarTest, ScrollbarRegression) { scoped_ptr<ExtensionInstallPrompt::Prompt> prompt = CreatePrompt(); prompt->SetPermissions(permissions, ExtensionInstallPrompt::REGULAR_PERMISSIONS); - ASSERT_FALSE(IsScrollbarVisible(prompt.Pass())) << "Scrollbar is visible"; + ASSERT_FALSE(IsScrollbarVisible(std::move(prompt))) << "Scrollbar is visible"; } class ExtensionInstallDialogViewTest diff --git a/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc index fc528bc..9934a89 100644 --- a/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc +++ b/chrome/browser/ui/views/extensions/extension_message_bubble_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/extensions/extension_message_bubble_view.h" +#include <utility> + #include "base/location.h" #include "base/single_thread_task_runner.h" #include "base/strings/utf_string_conversions.h" @@ -43,7 +45,7 @@ ExtensionMessageBubbleView::ExtensionMessageBubbleView( views::BubbleBorder::Arrow arrow_location, scoped_ptr<extensions::ExtensionMessageBubbleController> controller) : BubbleDelegateView(anchor_view, arrow_location), - controller_(controller.Pass()), + controller_(std::move(controller)), anchor_view_(anchor_view), headline_(NULL), learn_more_(NULL), diff --git a/chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bubble_views.cc b/chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bubble_views.cc index 24fefe36..a430ea5 100644 --- a/chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bubble_views.cc +++ b/chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bubble_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/extensions/extension_toolbar_icon_surfacing_bubble_views.h" +#include <utility> + #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" #include "chrome/grit/locale_settings.h" #include "ui/base/resource/resource_bundle.h" @@ -16,9 +18,8 @@ ExtensionToolbarIconSurfacingBubble::ExtensionToolbarIconSurfacingBubble( views::View* anchor_view, scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate) : views::BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), - delegate_(delegate.Pass()), - acknowledged_(false) { -} + delegate_(std::move(delegate)), + acknowledged_(false) {} ExtensionToolbarIconSurfacingBubble::~ExtensionToolbarIconSurfacingBubble() { } diff --git a/chrome/browser/ui/views/extensions/extension_view_views.cc b/chrome/browser/ui/views/extensions/extension_view_views.cc index 5f064ff..dc94db0 100644 --- a/chrome/browser/ui/views/extensions/extension_view_views.cc +++ b/chrome/browser/ui/views/extensions/extension_view_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/extensions/extension_view_views.h" +#include <utility> + #include "chrome/browser/extensions/extension_view_host.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" @@ -140,7 +142,7 @@ scoped_ptr<ExtensionView> ExtensionViewHost::CreateExtensionView( // We own |view_|, so don't auto delete when it's removed from the view // hierarchy. view->set_owned_by_client(); - return view.Pass(); + return std::move(view); } } // namespace extensions diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index 0eb50a1..5a7d0cb 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/external_protocol_dialog.h" +#include <utility> + #include "base/metrics/histogram.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -43,8 +45,8 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( } // Windowing system takes ownership. - new ExternalProtocolDialog( - delegate.Pass(), render_process_host_id, routing_id); + new ExternalProtocolDialog(std::move(delegate), render_process_host_id, + routing_id); } /////////////////////////////////////////////////////////////////////////////// @@ -125,7 +127,7 @@ ExternalProtocolDialog::ExternalProtocolDialog( scoped_ptr<const ProtocolDialogDelegate> delegate, int render_process_host_id, int routing_id) - : delegate_(delegate.Pass()), + : delegate_(std::move(delegate)), render_process_host_id_(render_process_host_id), routing_id_(routing_id), creation_time_(base::TimeTicks::Now()) { diff --git a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc index 464b319..bf97e0a 100644 --- a/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc +++ b/chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/frame/browser_desktop_window_tree_host_x11.h" +#include <utility> + #include "base/macros.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" @@ -79,7 +81,7 @@ BrowserDesktopWindowTreeHostX11::BrowserDesktopWindowTreeHostX11( browser_view_(browser_view) { scoped_ptr<ui::ThemeProvider> theme_provider( new DesktopThemeProvider(browser_view->browser()->profile())); - browser_frame->SetThemeProvider(theme_provider.Pass()); + browser_frame->SetThemeProvider(std::move(theme_provider)); browser_frame->set_frame_type( browser_frame->UseCustomFrame() ? views::Widget::FRAME_TYPE_FORCE_CUSTOM : views::Widget::FRAME_TYPE_FORCE_NATIVE); diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc index 8334cd5..3b3c5bfa 100644 --- a/chrome/browser/ui/views/frame/browser_frame.cc +++ b/chrome/browser/ui/views/frame/browser_frame.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/frame/browser_frame.h" +#include <utility> + #include "base/debug/leak_annotations.h" #include "base/i18n/rtl.h" #include "build/build_config.h" @@ -104,7 +106,7 @@ void BrowserFrame::InitBrowserFrame() { } void BrowserFrame::SetThemeProvider(scoped_ptr<ui::ThemeProvider> provider) { - owned_theme_provider_ = provider.Pass(); + owned_theme_provider_ = std::move(provider); theme_provider_ = owned_theme_provider_.get(); } diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.cc b/chrome/browser/ui/views/frame/browser_frame_ash.cc index b2be81d..94ffe37 100644 --- a/chrome/browser/ui/views/frame/browser_frame_ash.cc +++ b/chrome/browser/ui/views/frame/browser_frame_ash.cc @@ -63,9 +63,8 @@ BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame, Browser* browser = browser_view->browser(); ash::wm::WindowState* window_state = ash::wm::GetWindowState(GetNativeWindow()); - window_state->SetDelegate( - scoped_ptr<ash::wm::WindowStateDelegate>( - new BrowserWindowStateDelegate(browser)).Pass()); + window_state->SetDelegate(scoped_ptr<ash::wm::WindowStateDelegate>( + new BrowserWindowStateDelegate(browser))); // Turn on auto window management if we don't need an explicit bounds. // This way the requested bounds are honored. diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index b26c172..0f7ffd2 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/views/frame/browser_view.h" #include <stdint.h> - #include <algorithm> +#include <utility> #include "base/auto_reset.h" #include "base/command_line.h" @@ -1314,7 +1314,7 @@ void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { BookmarkBubbleView::ShowBubble(GetToolbarView()->GetBookmarkBubbleAnchor(), gfx::Rect(), nullptr, bookmark_bar_view_.get(), - delegate.Pass(), browser_->profile(), url, + std::move(delegate), browser_->profile(), url, already_bookmarked); } @@ -1379,7 +1379,7 @@ void BrowserView::ShowOneClickSigninBubble( anchor_view = toolbar_->location_bar(); OneClickSigninBubbleView::ShowBubble(type, email, error_message, - delegate.Pass(), anchor_view, + std::move(delegate), anchor_view, start_sync_callback); } #endif diff --git a/chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc b/chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc index 1aaa2ac..4f89f80 100644 --- a/chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc +++ b/chrome/browser/ui/views/infobars/alternate_nav_infobar_view.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/infobars/alternate_nav_infobar_view.h" #include <stddef.h> +#include <utility> #include "base/logging.h" #include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" @@ -19,7 +20,7 @@ // static scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( scoped_ptr<AlternateNavInfoBarDelegate> delegate) { - return make_scoped_ptr(new AlternateNavInfoBarView(delegate.Pass())); + return make_scoped_ptr(new AlternateNavInfoBarView(std::move(delegate))); } @@ -27,11 +28,10 @@ scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( AlternateNavInfoBarView::AlternateNavInfoBarView( scoped_ptr<AlternateNavInfoBarDelegate> delegate) - : InfoBarView(delegate.Pass()), + : InfoBarView(std::move(delegate)), label_1_(NULL), link_(NULL), - label_2_(NULL) { -} + label_2_(NULL) {} AlternateNavInfoBarView::~AlternateNavInfoBarView() { } diff --git a/chrome/browser/ui/views/infobars/confirm_infobar.cc b/chrome/browser/ui/views/infobars/confirm_infobar.cc index 415afcd..b2ba676 100644 --- a/chrome/browser/ui/views/infobars/confirm_infobar.cc +++ b/chrome/browser/ui/views/infobars/confirm_infobar.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/infobars/confirm_infobar.h" +#include <utility> + #include "base/logging.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/views/elevation_icon_setter.h" @@ -18,19 +20,18 @@ scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { - return make_scoped_ptr(new ConfirmInfoBar(delegate.Pass())); + return make_scoped_ptr(new ConfirmInfoBar(std::move(delegate))); } // ConfirmInfoBar ------------------------------------------------------------- ConfirmInfoBar::ConfirmInfoBar(scoped_ptr<ConfirmInfoBarDelegate> delegate) - : InfoBarView(delegate.Pass()), + : InfoBarView(std::move(delegate)), label_(NULL), ok_button_(NULL), cancel_button_(NULL), - link_(NULL) { -} + link_(NULL) {} ConfirmInfoBar::~ConfirmInfoBar() { // Ensure |elevation_icon_setter_| is destroyed before |ok_button_|. diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index c454d42..55f4e61 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/views/infobars/infobar_view.h" #include <algorithm> +#include <utility> #include "base/memory/scoped_ptr.h" #include "base/strings/utf_string_conversions.h" @@ -75,7 +76,7 @@ const int InfoBarView::kButtonButtonSpacing = views::kRelatedButtonHSpacing; const int InfoBarView::kEndOfLabelSpacing = views::kItemLabelSpacing; InfoBarView::InfoBarView(scoped_ptr<infobars::InfoBarDelegate> delegate) - : infobars::InfoBar(delegate.Pass()), + : infobars::InfoBar(std::move(delegate)), views::ExternalFocusTracker(this, NULL), icon_(NULL), close_button_(NULL) { @@ -134,7 +135,7 @@ views::LabelButton* InfoBarView::CreateLabelButton( false, views::Button::STATE_PRESSED, views::Painter::CreateImageGridPainter(kPressedImageSet)); - button->SetBorder(button_border.Pass()); + button->SetBorder(std::move(button_border)); button->set_animate_on_state_change(false); button->SetTextColor(views::Button::STATE_NORMAL, GetInfobarTextColor()); button->SetTextColor(views::Button::STATE_HOVERED, GetInfobarTextColor()); diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc index 6e5493a..fb958fe 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc @@ -475,7 +475,7 @@ scoped_ptr<gfx::RenderText> OmniboxResultView::CreateRenderText( render_text->SetElideBehavior(gfx::ELIDE_TAIL); render_text->SetFontList(font_list_); render_text->SetText(text); - return render_text.Pass(); + return render_text; } scoped_ptr<gfx::RenderText> OmniboxResultView::CreateClassifiedRenderText( @@ -519,7 +519,7 @@ scoped_ptr<gfx::RenderText> OmniboxResultView::CreateClassifiedRenderText( } render_text->ApplyColor(GetColor(GetState(), color_kind), current_range); } - return render_text.Pass(); + return render_text; } int OmniboxResultView::GetMatchContentsWidth() const { @@ -771,7 +771,7 @@ scoped_ptr<gfx::RenderText> OmniboxResultView::CreateAnswerLine( AppendAnswerText(destination.get(), space + text_field->text(), text_field->type()); } - return destination.Pass(); + return destination; } void OmniboxResultView::AppendAnswerText(gfx::RenderText* destination, diff --git a/chrome/browser/ui/views/panels/panel_view.cc b/chrome/browser/ui/views/panels/panel_view.cc index 2932e94..ddb61fb 100644 --- a/chrome/browser/ui/views/panels/panel_view.cc +++ b/chrome/browser/ui/views/panels/panel_view.cc @@ -5,8 +5,9 @@ #include "chrome/browser/ui/views/panels/panel_view.h" #include <stddef.h> - #include <map> +#include <utility> + #include "base/logging.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" @@ -333,7 +334,7 @@ PanelView::PanelView(Panel* panel, const gfx::Rect& bounds, bool always_on_top) window_->GetNativeView()->GetHost()->GetAcceleratedWidget()); scoped_ptr<ui::EventHandler> resizer( new X11PanelResizer(panel_.get(), window_->GetNativeWindow())); - host->SwapNonClientEventHandler(resizer.Pass()); + host->SwapNonClientEventHandler(std::move(resizer)); #endif } diff --git a/chrome/browser/ui/views/passwords/manage_password_items_view.cc b/chrome/browser/ui/views/passwords/manage_password_items_view.cc index eb0bca7..cd35ea5 100644 --- a/chrome/browser/ui/views/passwords/manage_password_items_view.cc +++ b/chrome/browser/ui/views/passwords/manage_password_items_view.cc @@ -74,7 +74,7 @@ scoped_ptr<views::Label> GenerateUsernameLabel( label->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( ui::ResourceBundle::SmallFont)); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); - return label.Pass(); + return label; } scoped_ptr<views::Label> GeneratePasswordLabel( @@ -90,7 +90,7 @@ scoped_ptr<views::Label> GeneratePasswordLabel( label->SetHorizontalAlignment(gfx::ALIGN_LEFT); if (form.federation_url.is_empty()) label->SetObscured(true); - return label.Pass(); + return label; } scoped_ptr<views::ImageButton> GenerateDeleteButton( @@ -103,7 +103,7 @@ scoped_ptr<views::ImageButton> GenerateDeleteButton( rb->GetImageNamed(IDR_CLOSE_2_H).ToImageSkia()); button->SetImage(views::ImageButton::STATE_PRESSED, rb->GetImageNamed(IDR_CLOSE_2_P).ToImageSkia()); - return button.Pass(); + return button; } scoped_ptr<views::Label> GenerateDeletedPasswordLabel() { @@ -112,7 +112,7 @@ scoped_ptr<views::Label> GenerateDeletedPasswordLabel() { text->SetHorizontalAlignment(gfx::ALIGN_LEFT); text->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( ui::ResourceBundle::SmallFont)); - return text.Pass(); + return text; } scoped_ptr<views::Link> GenerateUndoLink(views::LinkListener* listener) { @@ -123,7 +123,7 @@ scoped_ptr<views::Link> GenerateUndoLink(views::LinkListener* listener) { undo_link->SetUnderline(false); undo_link->SetFontList(ui::ResourceBundle::GetSharedInstance().GetFontList( ui::ResourceBundle::SmallFont)); - return undo_link.Pass(); + return undo_link; } } // namespace diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc index 1b1e7c5..988cd5b 100644 --- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc +++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" +#include <utility> + #include "base/command_line.h" #include "base/macros.h" #include "base/metrics/histogram_samples.h" @@ -314,8 +316,8 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, ChooseCredential) { net::URLRequestStatus::FAILED); EXPECT_CALL(url_callback, OnRequestDone(icon_url)); - SetupChooseCredentials(local_credentials.Pass(), federated_credentials.Pass(), - origin); + SetupChooseCredentials(std::move(local_credentials), + std::move(federated_credentials), origin); EXPECT_TRUE(IsBubbleShowing()); EXPECT_CALL(*this, OnChooseCredential( Field(&password_manager::CredentialInfo::type, @@ -338,8 +340,8 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, ChooseCredentialNoFocus) { content::RunAllPendingInMessageLoop(); EXPECT_FALSE(browser()->window()->IsActive()); - SetupChooseCredentials(local_credentials.Pass(), federated_credentials.Pass(), - origin); + SetupChooseCredentials(std::move(local_credentials), + std::move(federated_credentials), origin); EXPECT_TRUE(IsBubbleShowing()); } @@ -365,7 +367,7 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, AutoSignin) { net::URLRequestStatus::FAILED); EXPECT_CALL(url_callback, OnRequestDone(icon_url)); - SetupAutoSignin(local_credentials.Pass()); + SetupAutoSignin(std::move(local_credentials)); EXPECT_TRUE(IsBubbleShowing()); ManagePasswordsBubbleView::CloseBubble(); @@ -394,7 +396,7 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, AutoSigninNoFocus) { // Get rid of the warm welcome which makes the bubble sticky. password_bubble_experiment::RecordAutoSignInPromptFirstRunExperienceWasShown( browser()->profile()->GetPrefs()); - SetupAutoSignin(local_credentials.Pass()); + SetupAutoSignin(std::move(local_credentials)); content::RunAllPendingInMessageLoop(); EXPECT_TRUE(IsBubbleShowing()); diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc index eefaa5b..8e637bd 100644 --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/profiles/new_avatar_button.h" +#include <utility> + #include "base/win/windows_version.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" @@ -42,7 +44,7 @@ scoped_ptr<views::Border> CreateBorder(const int normal_image_set[], border->set_insets(gfx::Insets(kTopInset, kLeftRightInset, kBottomInset, kLeftRightInset)); - return border.Pass(); + return std::move(border); } } // namespace diff --git a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc index 6d4df0e..0a49a15 100644 --- a/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc +++ b/chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h" +#include <utility> + #include "base/command_line.h" #include "base/logging.h" #include "base/strings/string16.h" @@ -33,7 +35,7 @@ RenderViewContextMenuViews::RenderViewContextMenuViews( : RenderViewContextMenu(render_frame_host, params), bidi_submenu_model_(this) { scoped_ptr<ToolkitDelegate> delegate(new ToolkitDelegateViews); - set_toolkit_delegate(delegate.Pass()); + set_toolkit_delegate(std::move(delegate)); } RenderViewContextMenuViews::~RenderViewContextMenuViews() { diff --git a/chrome/browser/ui/views/session_crashed_bubble_view.cc b/chrome/browser/ui/views/session_crashed_bubble_view.cc index 3d65499..343a745 100644 --- a/chrome/browser/ui/views/session_crashed_bubble_view.cc +++ b/chrome/browser/ui/views/session_crashed_bubble_view.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/views/session_crashed_bubble_view.h" #include <stddef.h> - #include <string> +#include <utility> #include <vector> #include "base/bind.h" @@ -167,7 +167,7 @@ bool SessionCrashedBubble::Show(Browser* browser) { base::Bind(&SessionCrashedBubbleView::ShowForReal, base::Passed(&browser_observer))); #else - SessionCrashedBubbleView::ShowForReal(browser_observer.Pass(), false); + SessionCrashedBubbleView::ShowForReal(std::move(browser_observer), false); #endif // defined(GOOGLE_CHROME_BUILD) return true; diff --git a/chrome/browser/ui/views/settings_api_bubble_helper_views.cc b/chrome/browser/ui/views/settings_api_bubble_helper_views.cc index 62f1569..81caa2c 100644 --- a/chrome/browser/ui/views/settings_api_bubble_helper_views.cc +++ b/chrome/browser/ui/views/settings_api_bubble_helper_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/settings_api_bubble_helper_views.h" +#include <utility> + #include "build/build_config.h" #include "chrome/browser/extensions/ntp_overridden_bubble_delegate.h" #include "chrome/browser/extensions/settings_api_bubble_delegate.h" @@ -36,7 +38,7 @@ void ShowSettingsApiBubble(SettingsApiOverrideType type, return; ExtensionMessageBubbleView* bubble = new ExtensionMessageBubbleView( - anchor_view, arrow, settings_api_bubble.Pass()); + anchor_view, arrow, std::move(settings_api_bubble)); views::BubbleDelegateView::CreateBubble(bubble); bubble->Show(); } @@ -110,7 +112,7 @@ void MaybeShowExtensionControlledNewTabPage( BrowserView::GetBrowserViewForBrowser(browser) ->toolbar() ->app_menu_button(), - views::BubbleBorder::TOP_RIGHT, ntp_overridden_bubble.Pass()); + views::BubbleBorder::TOP_RIGHT, std::move(ntp_overridden_bubble)); views::BubbleDelegateView::CreateBubble(bubble); bubble->Show(); } diff --git a/chrome/browser/ui/views/ssl_client_certificate_selector.cc b/chrome/browser/ui/views/ssl_client_certificate_selector.cc index b646549..fb1c889 100644 --- a/chrome/browser/ui/views/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/views/ssl_client_certificate_selector.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/ssl_client_certificate_selector.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/strings/utf_string_conversions.h" @@ -29,8 +31,7 @@ SSLClientCertificateSelector::SSLClientCertificateSelector( : CertificateSelector(cert_request_info->client_certs, web_contents), SSLClientAuthObserver(web_contents->GetBrowserContext(), cert_request_info, - delegate.Pass()) { -} + std::move(delegate)) {} SSLClientCertificateSelector::~SSLClientCertificateSelector() { } @@ -45,7 +46,7 @@ void SSLClientCertificateSelector::Init() { text_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); text_label->SetAllowCharacterBreak(true); text_label->SizeToFit(kTableViewWidth); - InitWithText(text_label.Pass()); + InitWithText(std::move(text_label)); } void SSLClientCertificateSelector::OnCertSelectedByNotification() { @@ -109,7 +110,7 @@ void ShowSSLClientCertificateSelector( return; SSLClientCertificateSelector* selector = new SSLClientCertificateSelector( - contents, cert_request_info, delegate.Pass()); + contents, cert_request_info, std::move(delegate)); selector->Init(); selector->Show(); } diff --git a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc index d2e631f..df2cf75 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc +++ b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" +#include <utility> + #include "base/callback_helpers.h" #include "base/logging.h" #include "chrome/browser/ui/browser.h" @@ -61,18 +63,18 @@ void OneClickSigninBubbleView::ShowBubble( switch (type) { case BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE: bubble_view_ = new OneClickSigninBubbleView( - error_message, base::string16(), delegate.Pass(), - anchor_view, start_sync, false); + error_message, base::string16(), std::move(delegate), anchor_view, + start_sync, false); break; case BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG: bubble_view_ = new OneClickSigninBubbleView( - base::string16(), base::string16(), delegate.Pass(), - anchor_view, start_sync, true); + base::string16(), base::string16(), std::move(delegate), anchor_view, + start_sync, true); break; case BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_SAML_MODAL_DIALOG: bubble_view_ = new OneClickSigninBubbleView( - base::string16(), email, delegate.Pass(), - anchor_view, start_sync, true); + base::string16(), email, std::move(delegate), anchor_view, start_sync, + true); break; } @@ -98,7 +100,7 @@ OneClickSigninBubbleView::OneClickSigninBubbleView( const BrowserWindow::StartSyncCallback& start_sync_callback, bool is_sync_dialog) : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), - delegate_(delegate.Pass()), + delegate_(std::move(delegate)), error_message_(error_message), email_(email), start_sync_callback_(start_sync_callback), diff --git a/chrome/browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc b/chrome/browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc index a562662..56ef5ef 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" @@ -52,10 +54,7 @@ class OneClickSigninBubbleViewTest : public views::ViewsTestBase { delegate.reset(new OneClickSigninBubbleTestDelegate(this)); OneClickSigninBubbleView::ShowBubble( - bubble_type, - base::string16(), - base::string16(), - delegate.Pass(), + bubble_type, base::string16(), base::string16(), std::move(delegate), anchor_widget_->GetContentsView(), base::Bind(&OneClickSigninBubbleViewTest::OnStartSync, base::Unretained(this))); diff --git a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc index 3ec93e8..ba69241 100644 --- a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc +++ b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.h" +#include <utility> + #include "chrome/browser/defaults.h" #include "chrome/browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.h" #include "chrome/browser/ui/browser.h" @@ -131,12 +133,12 @@ ChromeWebContentsViewDelegateViews::BuildMenu( menu.reset(RenderViewContextMenuViews::Create(focused_frame, params)); menu->Init(); } - return menu.Pass(); + return menu; } void ChromeWebContentsViewDelegateViews::ShowMenu( scoped_ptr<RenderViewContextMenuBase> menu) { - context_menu_ = menu.Pass(); + context_menu_ = std::move(menu); if (!context_menu_) return; diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 1678a90..2f46cd3 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/views/tabs/tab.h" #include <stddef.h> - #include <limits> +#include <utility> #include "base/command_line.h" #include "base/debug/alias.h" @@ -608,7 +608,7 @@ void Tab::StartPulse() { } void Tab::StopPulse() { - StopAndDeleteAnimation(pulse_animation_.Pass()); + StopAndDeleteAnimation(std::move(pulse_animation_)); } void Tab::StartPinnedTabTitleAnimation() { @@ -641,7 +641,7 @@ void Tab::StartPinnedTabTitleAnimation() { } void Tab::StopPinnedTabTitleAnimation() { - StopAndDeleteAnimation(pinned_title_change_animation_.Pass()); + StopAndDeleteAnimation(std::move(pinned_title_change_animation_)); } int Tab::GetWidthOfLargestSelectableRegion() const { diff --git a/chrome/browser/ui/views/toolbar/app_menu_button.cc b/chrome/browser/ui/views/toolbar/app_menu_button.cc index e2839f5..984bac97 100644 --- a/chrome/browser/ui/views/toolbar/app_menu_button.cc +++ b/chrome/browser/ui/views/toolbar/app_menu_button.cc @@ -231,7 +231,7 @@ scoped_ptr<views::LabelButtonBorder> AppMenuButton::CreateDefaultBorder() insets += gfx::Insets(0, 0, 0, margin_trailing_); border->set_insets(insets); - return border.Pass(); + return border; } gfx::Rect AppMenuButton::GetThemePaintRect() const { diff --git a/chrome/browser/ui/views/toolbar/back_button.cc b/chrome/browser/ui/views/toolbar/back_button.cc index a0821bd..0a0f51d 100644 --- a/chrome/browser/ui/views/toolbar/back_button.cc +++ b/chrome/browser/ui/views/toolbar/back_button.cc @@ -52,7 +52,7 @@ scoped_ptr<views::LabelButtonBorder> BackButton::CreateDefaultBorder() const { border->set_insets(gfx::Insets(insets.top(), insets.left() + margin_leading_, insets.bottom(), insets.right())); - return border.Pass(); + return border; } gfx::Rect BackButton::GetThemePaintRect() const { diff --git a/chrome/browser/ui/views/toolbar/browser_actions_container.cc b/chrome/browser/ui/views/toolbar/browser_actions_container.cc index 29658f4..575eec3 100644 --- a/chrome/browser/ui/views/toolbar/browser_actions_container.cc +++ b/chrome/browser/ui/views/toolbar/browser_actions_container.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" +#include <utility> + #include "base/compiler_specific.h" #include "base/stl_util.h" #include "chrome/browser/extensions/extension_message_bubble_controller.h" @@ -339,10 +341,9 @@ void BrowserActionsContainer::ShowExtensionMessageBubble( ->app_menu_button(); extensions::ExtensionMessageBubbleView* bubble = - new extensions::ExtensionMessageBubbleView( - reference_view, - views::BubbleBorder::TOP_RIGHT, - controller.Pass()); + new extensions::ExtensionMessageBubbleView(reference_view, + views::BubbleBorder::TOP_RIGHT, + std::move(controller)); views::BubbleDelegateView::CreateBubble(bubble); active_bubble_ = bubble; active_bubble_->GetWidget()->AddObserver(this); diff --git a/chrome/browser/ui/views/toolbar/chevron_menu_button.cc b/chrome/browser/ui/views/toolbar/chevron_menu_button.cc index 78ceaa4..31baf8b 100644 --- a/chrome/browser/ui/views/toolbar/chevron_menu_button.cc +++ b/chrome/browser/ui/views/toolbar/chevron_menu_button.cc @@ -389,7 +389,7 @@ scoped_ptr<views::LabelButtonBorder> ChevronMenuButton::CreateDefaultBorder() scoped_ptr<views::LabelButtonBorder> border = views::MenuButton::CreateDefaultBorder(); border->set_insets(gfx::Insets()); - return border.Pass(); + return border; } bool ChevronMenuButton::GetDropFormats( diff --git a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc index 8404832..4bdb6df 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_action_view.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_action_view.cc @@ -110,7 +110,7 @@ scoped_ptr<LabelButtonBorder> ToolbarActionView::CreateDefaultBorder() const { scoped_ptr<LabelButtonBorder> border = LabelButton::CreateDefaultBorder(); border->set_insets(gfx::Insets(kBorderInset, kBorderInset, kBorderInset, kBorderInset)); - return border.Pass(); + return border; } void ToolbarActionView::OnMouseEntered(const ui::MouseEvent& event) { diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc index 0d63bd1..a9435ae 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_button.cc +++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc @@ -171,7 +171,7 @@ ToolbarButton::CreateDefaultBorder() const { if (ThemeServiceFactory::GetForProfile(profile_)->UsingSystemTheme()) border->set_insets(GetLayoutInsets(TOOLBAR_BUTTON)); - return border.Pass(); + return border; } void ToolbarButton::ShowContextMenuForView(View* source, diff --git a/chrome/browser/ui/views/translate/translate_bubble_view.cc b/chrome/browser/ui/views/translate/translate_bubble_view.cc index 84408c2..d8041d4 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/views/translate/translate_bubble_view.h" #include <stddef.h> - #include <algorithm> #include <string> +#include <utility> #include <vector> #include "base/i18n/string_compare.h" @@ -116,11 +116,9 @@ void TranslateBubbleView::ShowBubble( source_language, target_language)); scoped_ptr<TranslateBubbleModel> model( - new TranslateBubbleModelImpl(step, ui_delegate.Pass())); - TranslateBubbleView* view = new TranslateBubbleView(anchor_view, - model.Pass(), - error_type, - web_contents); + new TranslateBubbleModelImpl(step, std::move(ui_delegate))); + TranslateBubbleView* view = new TranslateBubbleView( + anchor_view, std::move(model), error_type, web_contents); views::BubbleDelegateView::CreateBubble(view); view->ShowForReason(reason); } @@ -260,7 +258,7 @@ TranslateBubbleView::TranslateBubbleView( always_translate_checkbox_(NULL), advanced_cancel_button_(NULL), advanced_done_button_(NULL), - model_(model.Pass()), + model_(std::move(model)), error_type_(error_type), is_in_incognito_window_( web_contents ? web_contents->GetBrowserContext()->IsOffTheRecord() diff --git a/chrome/browser/ui/views/translate/translate_bubble_view_unittest.cc b/chrome/browser/ui/views/translate/translate_bubble_view_unittest.cc index 45be814..9a0b969 100644 --- a/chrome/browser/ui/views/translate/translate_bubble_view_unittest.cc +++ b/chrome/browser/ui/views/translate/translate_bubble_view_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/views/translate/translate_bubble_view.h" +#include <utility> + #include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/translate/translate_bubble_model.h" #include "chrome/browser/ui/translate/translate_bubble_view_state_transition.h" @@ -143,9 +145,8 @@ class TranslateBubbleViewTest : public views::ViewsTestBase { TranslateBubbleModel::VIEW_STATE_BEFORE_TRANSLATE); scoped_ptr<TranslateBubbleModel> model(mock_model_); bubble_ = new TranslateBubbleView(anchor_widget_->GetContentsView(), - model.Pass(), - translate::TranslateErrors::NONE, - NULL); + std::move(model), + translate::TranslateErrors::NONE, NULL); views::BubbleDelegateView::CreateBubble(bubble_)->Show(); } diff --git a/chrome/browser/ui/webui/browsing_history_handler.cc b/chrome/browser/ui/webui/browsing_history_handler.cc index 2ca90cc..253a80c 100644 --- a/chrome/browser/ui/webui/browsing_history_handler.cc +++ b/chrome/browser/ui/webui/browsing_history_handler.cc @@ -273,7 +273,7 @@ scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue( } #endif - return result.Pass(); + return result; } bool BrowsingHistoryHandler::HistoryEntry::SortByTimeDescending( diff --git a/chrome/browser/ui/webui/copresence_ui.cc b/chrome/browser/ui/webui/copresence_ui.cc index c71134e..9fb2166 100644 --- a/chrome/browser/ui/webui/copresence_ui.cc +++ b/chrome/browser/ui/webui/copresence_ui.cc @@ -53,7 +53,7 @@ scoped_ptr<WebUIDataSource> CreateDataSource() { data_source->AddResourcePath("copresence.js", IDR_COPRESENCE_JS); data_source->SetDefaultResource(IDR_COPRESENCE_HTML); - return data_source.Pass(); + return data_source; } } // namespace diff --git a/chrome/browser/ui/webui/copresence_ui_handler.cc b/chrome/browser/ui/webui/copresence_ui_handler.cc index 72da86bba..9bacd39 100644 --- a/chrome/browser/ui/webui/copresence_ui_handler.cc +++ b/chrome/browser/ui/webui/copresence_ui_handler.cc @@ -98,7 +98,7 @@ scoped_ptr<DictionaryValue> FormatToken(const T& token) { js_token->SetString("time", base::TimeFormatTimeOfDay(token.start_time)); - return js_token.Pass(); + return js_token; } // Retrieve the CopresenceService, if any. diff --git a/chrome/browser/ui/webui/engagement/site_engagement_ui.cc b/chrome/browser/ui/webui/engagement/site_engagement_ui.cc index f1c29e8..76c34549 100644 --- a/chrome/browser/ui/webui/engagement/site_engagement_ui.cc +++ b/chrome/browser/ui/webui/engagement/site_engagement_ui.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/engagement/site_engagement_ui.h" +#include <utility> + #include "base/macros.h" #include "chrome/browser/engagement/site_engagement_service.h" #include "chrome/browser/profiles/profile.h" @@ -25,7 +27,7 @@ class SiteEngagementUIHandlerImpl : public SiteEngagementUIHandler { SiteEngagementUIHandlerImpl( Profile* profile, mojo::InterfaceRequest<SiteEngagementUIHandler> request) - : profile_(profile), binding_(this, request.Pass()) { + : profile_(profile), binding_(this, std::move(request)) { DCHECK(profile_); } @@ -42,10 +44,10 @@ class SiteEngagementUIHandlerImpl : public SiteEngagementUIHandler { SiteEngagementInfoPtr origin_info(SiteEngagementInfo::New()); origin_info->origin = mojo::String::From(info.first); origin_info->score = info.second; - engagement_info.push_back(origin_info.Pass()); + engagement_info.push_back(std::move(origin_info)); } - callback.Run(engagement_info.Pass()); + callback.Run(std::move(engagement_info)); } private: @@ -85,5 +87,5 @@ SiteEngagementUI::~SiteEngagementUI() {} void SiteEngagementUI::BindUIHandler( mojo::InterfaceRequest<SiteEngagementUIHandler> request) { ui_handler_.reset(new SiteEngagementUIHandlerImpl( - Profile::FromWebUI(web_ui()), request.Pass())); + Profile::FromWebUI(web_ui()), std::move(request))); } diff --git a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc index c7a3a20..9cf3342 100644 --- a/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc +++ b/chrome/browser/ui/webui/extensions/extension_settings_browsertest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/extensions/extension_settings_browsertest.h" #include <stddef.h> +#include <utility> #include "base/files/file_path.h" #include "base/path_service.h" @@ -160,7 +161,7 @@ const Extension* ExtensionSettingsUIBrowserTest::InstallExtension( return nullptr; scoped_refptr<extensions::CrxInstaller> installer( - extensions::CrxInstaller::Create(service, install_ui.Pass())); + extensions::CrxInstaller::Create(service, std::move(install_ui))); installer->set_expected_id(std::string()); installer->set_is_gallery_install(false); installer->set_install_source(extensions::Manifest::INTERNAL); diff --git a/chrome/browser/ui/webui/extensions/install_extension_handler.cc b/chrome/browser/ui/webui/extensions/install_extension_handler.cc index 0e4b82f..2d504f3 100644 --- a/chrome/browser/ui/webui/extensions/install_extension_handler.cc +++ b/chrome/browser/ui/webui/extensions/install_extension_handler.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/extensions/install_extension_handler.h" +#include <utility> + #include "base/bind.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -106,7 +108,7 @@ void InstallExtensionHandler::HandleInstallMessage( scoped_ptr<ExtensionInstallPrompt> prompt( new ExtensionInstallPrompt(web_ui()->GetWebContents())); scoped_refptr<CrxInstaller> crx_installer(CrxInstaller::Create( - ExtensionSystem::Get(profile)->extension_service(), prompt.Pass())); + ExtensionSystem::Get(profile)->extension_service(), std::move(prompt))); crx_installer->set_error_on_unsupported_requirements(true); crx_installer->set_off_store_install_allow_reason( CrxInstaller::OffStoreInstallAllowedFromSettingsPage); diff --git a/chrome/browser/ui/webui/foreign_session_handler.cc b/chrome/browser/ui/webui/foreign_session_handler.cc index e731f6b..076f89f 100644 --- a/chrome/browser/ui/webui/foreign_session_handler.cc +++ b/chrome/browser/ui/webui/foreign_session_handler.cc @@ -70,7 +70,7 @@ scoped_ptr<base::DictionaryValue> SessionTabToValue( // confusion with the ID corresponding to a session. Investigate all the // places (C++ and JS) where this is being used. (http://crbug.com/154865). dictionary->SetInteger("sessionId", tab.tab_id.id()); - return dictionary.Pass(); + return dictionary; } // Helper for initializing a boilerplate SessionWindow JSON compatible object. @@ -94,7 +94,7 @@ scoped_ptr<base::DictionaryValue> BuildWindowData( ui::TimeFormat::LENGTH_SHORT, last_synced)); dictionary->SetInteger("sessionId", window_id); - return dictionary.Pass(); + return dictionary; } // Helper method to create JSON compatible objects from SessionWindow objects. @@ -118,7 +118,7 @@ scoped_ptr<base::DictionaryValue> SessionWindowToValue( scoped_ptr<base::DictionaryValue> dictionary( BuildWindowData(window.timestamp, window.window_id.id())); dictionary->Set("tabs", tab_values.release()); - return dictionary.Pass(); + return dictionary; } } // namespace diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc index 04a8a03..e623163 100644 --- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc +++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h" #include <set> +#include <utility> #include "base/bind.h" #include "base/command_line.h" @@ -66,7 +67,7 @@ scoped_ptr<base::DictionaryValue> CreateDeviceInfo( return_value->SetString(kDictionaryKeyDescription, description.description); return_value->SetString(kDictionaryKeyType, description.type); - return return_value.Pass(); + return return_value; } void ReadDevicesList( @@ -268,7 +269,8 @@ void LocalDiscoveryUIHandler::HandleShowSyncUI( void LocalDiscoveryUIHandler::StartRegisterHTTP( scoped_ptr<PrivetHTTPClient> http_client) { - current_http_client_ = PrivetV1HTTPClient::CreateDefault(http_client.Pass()); + current_http_client_ = + PrivetV1HTTPClient::CreateDefault(std::move(http_client)); std::string user = GetSyncAccount(); diff --git a/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc b/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc index a98c0d2..24d5d16 100644 --- a/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc +++ b/chrome/browser/ui/webui/md_downloads/downloads_list_tracker.cc @@ -123,7 +123,7 @@ void DownloadsListTracker::StartAndSendChunk() { base::ListValue list; while (it != sorted_items_.end() && list.GetSize() < chunk_size_) { - list.Append(CreateDownloadItemValue(*it).Pass()); + list.Append(CreateDownloadItemValue(*it)); ++it; } @@ -308,7 +308,7 @@ scoped_ptr<base::DictionaryValue> DownloadsListTracker::CreateDownloadItemValue( file_value->SetBoolean("retry", retry); file_value->SetString("state", state); - return file_value.Pass(); + return file_value; } bool DownloadsListTracker::IsIncognito(const DownloadItem& item) const { @@ -382,7 +382,7 @@ void DownloadsListTracker::InsertItem(const SortedSet::iterator& insert) { return; base::ListValue list; - list.Append(CreateDownloadItemValue(*insert).Pass()); + list.Append(CreateDownloadItemValue(*insert)); web_ui_->CallJavascriptFunction( "downloads.Manager.insertItems", diff --git a/chrome/browser/ui/webui/md_downloads/downloads_list_tracker_unittest.cc b/chrome/browser/ui/webui/md_downloads/downloads_list_tracker_unittest.cc index 2cc4df2..a4296bc 100644 --- a/chrome/browser/ui/webui/md_downloads/downloads_list_tracker_unittest.cc +++ b/chrome/browser/ui/webui/md_downloads/downloads_list_tracker_unittest.cc @@ -90,7 +90,7 @@ class TestDownloadsListTracker : public DownloadsListTracker { scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue); CHECK_LE(item->GetId(), static_cast<uint64_t>(INT_MAX)); dict->SetInteger("id", item->GetId()); - return dict.Pass(); + return dict; } }; diff --git a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc index 98125cb..a58dbdd 100644 --- a/chrome/browser/ui/webui/media/webrtc_logs_ui.cc +++ b/chrome/browser/ui/webui/media/webrtc_logs_ui.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/media/webrtc_logs_ui.h" +#include <utility> #include <vector> #include "base/bind.h" @@ -194,7 +195,7 @@ void WebRtcLogsDOMHandler::UpdateUI() { value_w = base::string16(base::ASCIIToUTF16("(unknown time)")); upload->SetString("capture_time", value_w); - upload_list.Append(upload.Pass()); + upload_list.Append(std::move(upload)); } base::StringValue version(version_info::GetVersionNumber()); diff --git a/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc b/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc index f43aadb..1395290 100644 --- a/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc +++ b/chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.h" #include <string> +#include <utility> #include <vector> #include "base/macros.h" @@ -302,7 +303,7 @@ void MediaRouterDialogControllerImpl::PopulateDialog( media_router_ui->InitWithDefaultMediaSource(delegate); } else { media_router_ui->InitWithPresentationSessionRequest( - initiator(), delegate, create_connection_request.Pass()); + initiator(), delegate, std::move(create_connection_request)); } } diff --git a/chrome/browser/ui/webui/media_router/media_router_ui.cc b/chrome/browser/ui/webui/media_router/media_router_ui.cc index cda8494..3e47007 100644 --- a/chrome/browser/ui/webui/media_router/media_router_ui.cc +++ b/chrome/browser/ui/webui/media_router/media_router_ui.cc @@ -6,6 +6,7 @@ #include <algorithm> #include <string> +#include <utility> #include "base/guid.h" #include "base/i18n/string_compare.h" @@ -209,7 +210,7 @@ void MediaRouterUI::InitWithPresentationSessionRequest( DCHECK(!create_session_request_); DCHECK(!query_result_manager_); - create_session_request_ = create_session_request.Pass(); + create_session_request_ = std::move(create_session_request); presentation_service_delegate_ = delegate; InitCommon(initiator); OnDefaultPresentationChanged(create_session_request_->presentation_request()); diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc index db1bf83..34eeac2 100644 --- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc +++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc @@ -65,7 +65,7 @@ scoped_ptr<base::ListValue> SinksToValue( value->Append(sink_val.release()); } - return value.Pass(); + return value; } scoped_ptr<base::DictionaryValue> RouteToValue( @@ -86,7 +86,7 @@ scoped_ptr<base::DictionaryValue> RouteToValue( full_custom_controller_path); } - return dictionary.Pass(); + return dictionary; } scoped_ptr<base::ListValue> RoutesToValue( @@ -99,7 +99,7 @@ scoped_ptr<base::ListValue> RoutesToValue( value->Append(route_val.release()); } - return value.Pass(); + return value; } scoped_ptr<base::ListValue> CastModesToValue(const CastModeSet& cast_modes, @@ -115,7 +115,7 @@ scoped_ptr<base::ListValue> CastModesToValue(const CastModeSet& cast_modes, value->Append(cast_mode_val.release()); } - return value.Pass(); + return value; } // Returns an Issue dictionary created from |issue| that can be used in WebUI. @@ -133,7 +133,7 @@ scoped_ptr<base::DictionaryValue> IssueToValue(const Issue& issue) { dictionary->SetString("routeId", issue.route_id()); dictionary->SetBoolean("isBlocking", issue.is_blocking()); - return dictionary.Pass(); + return dictionary; } bool IsValidIssueActionTypeNum(int issue_action_type_num) { diff --git a/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc b/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc index 08515fd..e1ef734 100644 --- a/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc +++ b/chrome/browser/ui/webui/memory_internals/memory_internals_proxy.cc @@ -153,7 +153,8 @@ class RendererDetails { if (service_registry) service_registry->ConnectToRemoteService(mojo::GetProxy(&service)); resource_usage_reporters_.insert(std::make_pair( - content, make_linked_ptr(new ProcessResourceUsage(service.Pass())))); + content, + make_linked_ptr(new ProcessResourceUsage(std::move(service))))); DCHECK_EQ(web_contents_.size(), resource_usage_reporters_.size()); } diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc index 4ff6414..4d21da6 100644 --- a/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc +++ b/chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/net_internals/net_internals_ui_browsertest.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" @@ -291,9 +293,9 @@ void NetInternalsTest::MessageHandler::GetNetLogFileContents( chrome::GetChannelString())); scoped_ptr<net::WriteToFileNetLogObserver> net_log_logger( new net::WriteToFileNetLogObserver()); - net_log_logger->StartObserving( - g_browser_process->net_log(), temp_file_handle.Pass(), constants.get(), - nullptr); + net_log_logger->StartObserving(g_browser_process->net_log(), + std::move(temp_file_handle), constants.get(), + nullptr); g_browser_process->net_log()->AddGlobalEntry( net::NetLog::TYPE_NETWORK_IP_ADDRESSES_CHANGED); net::BoundNetLog bound_net_log = net::BoundNetLog::Make( diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc index 0c8021d..09bf3f4 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc +++ b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" +#include <utility> + #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h" #include "chrome/common/url_constants.h" @@ -31,5 +33,5 @@ OmniboxUI::~OmniboxUI() {} void OmniboxUI::BindUIHandler( mojo::InterfaceRequest<OmniboxUIHandlerMojo> request) { omnibox_ui_handler_.reset( - new OmniboxUIHandler(Profile::FromWebUI(web_ui()), request.Pass())); + new OmniboxUIHandler(Profile::FromWebUI(web_ui()), std::move(request))); } diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc index 6d2792f..d6192ef 100644 --- a/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc +++ b/chrome/browser/ui/webui/omnibox/omnibox_ui_handler.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h" #include <stddef.h> - #include <string> +#include <utility> #include "base/auto_reset.h" #include "base/bind.h" @@ -49,9 +49,9 @@ struct TypeConverter<mojo::Array<AutocompleteAdditionalInfoPtr>, AutocompleteAdditionalInfoPtr item(AutocompleteAdditionalInfo::New()); item->key = i->first; item->value = i->second; - array[index] = item.Pass(); + array[index] = std::move(item); } - return array.Pass(); + return array; } }; @@ -90,7 +90,7 @@ struct TypeConverter<AutocompleteMatchMojoPtr, AutocompleteMatch> { result->additional_info = mojo::Array<AutocompleteAdditionalInfoPtr>::From(input.additional_info); - return result.Pass(); + return result; } }; @@ -104,7 +104,7 @@ struct TypeConverter<AutocompleteResultsForProviderMojoPtr, result->provider_name = input->GetName(); result->results = mojo::Array<AutocompleteMatchMojoPtr>::From(input->matches()); - return result.Pass(); + return result; } }; @@ -113,8 +113,7 @@ struct TypeConverter<AutocompleteResultsForProviderMojoPtr, OmniboxUIHandler::OmniboxUIHandler( Profile* profile, mojo::InterfaceRequest<OmniboxUIHandlerMojo> request) - : profile_(profile), - binding_(this, request.Pass()) { + : profile_(profile), binding_(this, std::move(request)) { ResetController(); } @@ -164,7 +163,7 @@ void OmniboxUIHandler::OnResultChanged(bool default_match_changed) { } } - page_->HandleNewAutocompleteResult(result.Pass()); + page_->HandleNewAutocompleteResult(std::move(result)); } bool OmniboxUIHandler::LookupIsTypedHost(const base::string16& host, @@ -193,7 +192,7 @@ void OmniboxUIHandler::StartOmniboxQuery(const mojo::String& input_string, // important logic and return stale results. In short, we want the // actual results to not depend on the state of the previous request. ResetController(); - page_ = page.Pass(); + page_ = std::move(page); time_omnibox_started_ = base::Time::Now(); input_ = AutocompleteInput( input_string.To<base::string16>(), cursor_position, std::string(), GURL(), diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc index f9d5531..28fb030 100644 --- a/chrome/browser/ui/webui/options/autofill_options_handler.cc +++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc @@ -80,7 +80,7 @@ scoped_ptr<base::DictionaryValue> CreditCardToDictionary( value->SetBoolean("isLocal", card.record_type() == CreditCard::LOCAL_CARD); value->SetBoolean("isCached", card.record_type() == CreditCard::FULL_SERVER_CARD); - return value.Pass(); + return value; } // Fills |components| with the address UI components that should be used to diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index b29ae74..b081f9c5 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -1321,7 +1321,7 @@ scoped_ptr<base::ListValue> BrowserOptionsHandler::GetProfilesInfoList() { profile_info_list->Append(profile_value); } - return profile_info_list.Pass(); + return profile_info_list; } void BrowserOptionsHandler::SendProfilesInfo() { @@ -1423,7 +1423,7 @@ BrowserOptionsHandler::GetSyncStateDictionary() { // Cannot display signin status when running in guest mode on chromeos // because there is no SigninManager. sync_status->SetBoolean("signinAllowed", false); - return sync_status.Pass(); + return sync_status; } sync_status->SetBoolean("supervisedUser", profile->IsSupervised()); @@ -1463,7 +1463,7 @@ BrowserOptionsHandler::GetSyncStateDictionary() { sync_status->SetBoolean("hasUnrecoverableError", service && service->HasUnrecoverableError()); - return sync_status.Pass(); + return sync_status; } void BrowserOptionsHandler::HandleSelectDownloadLocation( diff --git a/chrome/browser/ui/webui/options/certificate_manager_handler.cc b/chrome/browser/ui/webui/options/certificate_manager_handler.cc index 5138a67..9ac2a69 100644 --- a/chrome/browser/ui/webui/options/certificate_manager_handler.cc +++ b/chrome/browser/ui/webui/options/certificate_manager_handler.cc @@ -7,9 +7,9 @@ #include <errno.h> #include <stddef.h> #include <stdint.h> - #include <algorithm> #include <map> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -1050,7 +1050,7 @@ void CertificateManagerHandler::Delete(const base::ListValue* args) { void CertificateManagerHandler::OnCertificateManagerModelCreated( scoped_ptr<CertificateManagerModel> model) { - certificate_manager_model_ = model.Pass(); + certificate_manager_model_ = std::move(model); CertificateManagerModelReady(); } diff --git a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc index df0e607..eafdd44 100644 --- a/chrome/browser/ui/webui/options/clear_browser_data_handler.cc +++ b/chrome/browser/ui/webui/options/clear_browser_data_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" #include <stddef.h> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -462,7 +463,7 @@ void ClearBrowserDataHandler::AddCounter( Profile::FromWebUI(web_ui()), base::Bind(&ClearBrowserDataHandler::UpdateCounterText, base::Unretained(this))); - counters_.push_back(counter.Pass()); + counters_.push_back(std::move(counter)); } void ClearBrowserDataHandler::UpdateCounterText( diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index f26c435..935897c 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/webui/options/content_settings_handler.h" #include <stddef.h> - #include <algorithm> #include <map> +#include <utility> #include <vector> #include "base/bind.h" @@ -381,7 +381,7 @@ scoped_ptr<base::DictionaryValue> GetChooserExceptionForPage( exception->SetString(kObjectName, name); exception->Set(kObject, object->CreateDeepCopy()); } - return exception.Pass(); + return exception; } // Returns true whenever the |extension| is hosted and has |permission|. @@ -1184,7 +1184,7 @@ void ContentSettingsHandler::UpdateChooserExceptionsViewFromModel( base::ListValue exceptions; for (auto& one_provider_exceptions : all_provider_exceptions) { for (auto& exception : one_provider_exceptions) - exceptions.Append(exception.Pass()); + exceptions.Append(std::move(exception)); } base::StringValue type_string(chooser_type.name); @@ -1424,7 +1424,7 @@ void ContentSettingsHandler::GetExceptionsFromHostContentSettingsMap( for (auto& one_provider_exceptions : all_provider_exceptions) { for (auto& exception : one_provider_exceptions) - exceptions->Append(exception.Pass()); + exceptions->Append(std::move(exception)); } } diff --git a/chrome/browser/ui/webui/options/cookies_view_handler.cc b/chrome/browser/ui/webui/options/cookies_view_handler.cc index 17ea9d7..e13abda 100644 --- a/chrome/browser/ui/webui/options/cookies_view_handler.cc +++ b/chrome/browser/ui/webui/options/cookies_view_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/options/cookies_view_handler.h" #include <string> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -154,7 +155,7 @@ void CookiesViewHandler::TreeNodesAdded(ui::TreeModel* model, else args.AppendString(model_util_->GetTreeNodeId(parent_node)); args.AppendInteger(start); - args.Append(children.Pass()); + args.Append(std::move(children)); web_ui()->CallJavascriptFunction("CookiesView.onTreeItemAdded", args); } @@ -274,7 +275,7 @@ void CookiesViewHandler::SendChildren(const CookieTreeNode* parent) { args.Append(base::Value::CreateNullValue()); else args.AppendString(model_util_->GetTreeNodeId(parent)); - args.Append(children.Pass()); + args.Append(std::move(children)); web_ui()->CallJavascriptFunction("CookiesView.loadChildren", args); } diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc index b15d207..9cf0f7e 100644 --- a/chrome/browser/ui/webui/options/core_options_handler.cc +++ b/chrome/browser/ui/webui/options/core_options_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/options/core_options_handler.h" #include <stddef.h> +#include <utility> #include "base/bind.h" #include "base/bind_helpers.h" @@ -346,7 +347,7 @@ void CoreOptionsHandler::NotifyPrefChanged( const std::string& controlling_pref_name) { scoped_ptr<base::Value> value( CreateValueForPref(pref_name, controlling_pref_name)); - DispatchPrefChangeNotification(pref_name, value.Pass()); + DispatchPrefChangeNotification(pref_name, std::move(value)); } void CoreOptionsHandler::DispatchPrefChangeNotification( diff --git a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc index ff78249..2d80ae6 100644 --- a/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc +++ b/chrome/browser/ui/webui/options/reset_profile_settings_handler.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/options/reset_profile_settings_handler.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" @@ -212,11 +214,9 @@ void ResetProfileSettingsHandler::ResetProfile(bool send_settings) { if (!default_settings) default_settings.reset(new BrandcodedDefaultSettings); resetter_->Reset( - ProfileResetter::ALL, - default_settings.Pass(), + ProfileResetter::ALL, std::move(default_settings), base::Bind(&ResetProfileSettingsHandler::OnResetProfileSettingsDone, - AsWeakPtr(), - send_settings)); + AsWeakPtr(), send_settings)); content::RecordAction(base::UserMetricsAction("ResetProfile")); UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings); } diff --git a/chrome/browser/ui/webui/options/supervised_user_import_handler.cc b/chrome/browser/ui/webui/options/supervised_user_import_handler.cc index 1721606..4af6aeb 100644 --- a/chrome/browser/ui/webui/options/supervised_user_import_handler.cc +++ b/chrome/browser/ui/webui/options/supervised_user_import_handler.cc @@ -40,7 +40,7 @@ scoped_ptr<base::ListValue> GetAvatarIcons() { avatar_icons->Append(new base::StringValue(avatar_url)); } - return avatar_icons.Pass(); + return avatar_icons; } bool ProfileIsLegacySupervised(const base::FilePath& profile_path) { diff --git a/chrome/browser/ui/webui/policy_material_design_ui.cc b/chrome/browser/ui/webui/policy_material_design_ui.cc index 39376ac..081b0a2 100644 --- a/chrome/browser/ui/webui/policy_material_design_ui.cc +++ b/chrome/browser/ui/webui/policy_material_design_ui.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/policy_material_design_ui.h" #include <stddef.h> +#include <utility> #include "base/macros.h" #include "chrome/browser/profiles/profile.h" @@ -77,7 +78,7 @@ void PolicyMaterialDesignUIHandler::AddPolicyName( if (tags[i] != policy::RISK_TAG_NONE) list->AppendString(kPolicyRiskTags[tags[i]].key); } - names->Set(name, list.Pass()); + names->Set(name, std::move(list)); } void PolicyMaterialDesignUIHandler::SendPolicyNames() const { diff --git a/chrome/browser/ui/webui/policy_ui_handler.cc b/chrome/browser/ui/webui/policy_ui_handler.cc index 602d511..c4a9b4a 100644 --- a/chrome/browser/ui/webui/policy_ui_handler.cc +++ b/chrome/browser/ui/webui/policy_ui_handler.cc @@ -190,7 +190,7 @@ scoped_ptr<base::Value> CopyAndConvert(const base::Value* value) { } } - return copy.Pass(); + return copy; } } // namespace diff --git a/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc b/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc index 9be255d..d2af813 100644 --- a/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc +++ b/chrome/browser/ui/webui/print_preview/extension_printer_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/print_preview/extension_printer_handler.h" #include <algorithm> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -62,7 +63,7 @@ scoped_ptr<extensions::PrinterProviderPrintJob> UpdateJobFileInfoOnWorkerThread( scoped_ptr<extensions::PrinterProviderPrintJob> job) { if (base::GetFileInfo(raster_path, &job->file_info)) job->document_path = raster_path; - return job.Pass(); + return job; } // Callback to PWG raster conversion. @@ -75,7 +76,7 @@ void UpdateJobFileInfo( bool success, const base::FilePath& pwg_file_path) { if (!success) { - callback.Run(job.Pass()); + callback.Run(std::move(job)); return; } @@ -207,7 +208,7 @@ void ExtensionPrinterHandler::StartPrint( // the same way as it's done with PWG raster. print_job->content_type = kContentTypePdf; print_job->document_bytes = print_data; - DispatchPrintJob(callback, print_job.Pass()); + DispatchPrintJob(callback, std::move(print_job)); return; } @@ -219,7 +220,7 @@ void ExtensionPrinterHandler::StartPrint( print_job->content_type = kContentTypePWGRaster; ConvertToPWGRaster(print_data, printer_description, ticket, page_size, - print_job.Pass(), + std::move(print_job), base::Bind(&ExtensionPrinterHandler::DispatchPrintJob, weak_ptr_factory_.GetWeakPtr(), callback)); } @@ -255,7 +256,7 @@ void ExtensionPrinterHandler::StartGrantPrinterAccess( void ExtensionPrinterHandler::SetPwgRasterConverterForTesting( scoped_ptr<local_discovery::PWGRasterConverter> pwg_raster_converter) { - pwg_raster_converter_ = pwg_raster_converter.Pass(); + pwg_raster_converter_ = std::move(pwg_raster_converter); } void ExtensionPrinterHandler::ConvertToPWGRaster( diff --git a/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc b/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc index 4b2d235..f3076d9 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_distiller.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/webui/print_preview/print_preview_distiller.h" #include <stdint.h> - #include <string> +#include <utility> #include "base/command_line.h" #include "base/feature_list.h" @@ -46,7 +46,7 @@ class PrintPreviewDistiller::WebContentsDelegateImpl scoped_ptr<base::DictionaryValue> settings, const base::Closure on_failed_callback) : content::WebContentsObserver(web_contents), - settings_(settings.Pass()), + settings_(std::move(settings)), on_failed_callback_(on_failed_callback) { web_contents->SetDelegate(this); @@ -224,7 +224,7 @@ PrintPreviewDistiller::PrintPreviewDistiller( content::SessionStorageNamespace* session_storage_namespace = source_web_contents->GetController().GetDefaultSessionStorageNamespace(); CreateDestinationWebContents(session_storage_namespace, source_web_contents, - settings.Pass(), on_failed_callback); + std::move(settings), on_failed_callback); DCHECK(web_contents_); ::DistillAndView(source_web_contents, web_contents_.get()); @@ -244,7 +244,7 @@ void PrintPreviewDistiller::CreateDestinationWebContents( web_contents_.get()); web_contents_delegate_.reset(new WebContentsDelegateImpl( - web_contents_.get(), settings.Pass(), on_failed_callback)); + web_contents_.get(), std::move(settings), on_failed_callback)); // Set the size of the distilled WebContents. ResizeWebContents(web_contents_.get(), gfx::Size(1, 1)); diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc index 4e43db2..5af7461 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc @@ -6,9 +6,9 @@ #include <ctype.h> #include <stddef.h> - #include <map> #include <string> +#include <utility> #include "base/base64.h" #include "base/bind.h" @@ -424,7 +424,7 @@ scoped_ptr<base::DictionaryValue> GetLocalPrinterCapabilitiesOnFileThread( return scoped_ptr<base::DictionaryValue>(); } - return description.Pass(); + return description; } void EnumeratePrintersOnFileThread(base::ListValue* printers) { @@ -873,7 +873,7 @@ void PrintPreviewHandler::HandleGetPreview(const base::ListValue* args) { print_preview_distiller_.reset(new PrintPreviewDistiller( initiator, base::Bind(&PrintPreviewUI::OnPrintPreviewFailed, print_preview_ui()->GetWeakPtr()), - settings.Pass())); + std::move(settings))); } else { RenderViewHost* rvh = initiator->GetRenderViewHost(); rvh->Send(new PrintMsg_PrintPreview(rvh->GetRoutingID(), *settings)); @@ -1576,7 +1576,7 @@ void PrintPreviewHandler::LocalPrinterCacheFlushed() { void PrintPreviewHandler::PrivetCapabilitiesUpdateClient( scoped_ptr<local_discovery::PrivetHTTPClient> http_client) { - if (!PrivetUpdateClient(http_client.Pass())) + if (!PrivetUpdateClient(std::move(http_client))) return; privet_capabilities_operation_ = @@ -1596,8 +1596,8 @@ bool PrintPreviewHandler::PrivetUpdateClient( privet_local_print_operation_.reset(); privet_capabilities_operation_.reset(); - privet_http_client_ = - local_discovery::PrivetV1HTTPClient::CreateDefault(http_client.Pass()); + privet_http_client_ = local_discovery::PrivetV1HTTPClient::CreateDefault( + std::move(http_client)); privet_http_resolution_.reset(); @@ -1609,7 +1609,7 @@ void PrintPreviewHandler::PrivetLocalPrintUpdateClient( std::string capabilities, gfx::Size page_size, scoped_ptr<local_discovery::PrivetHTTPClient> http_client) { - if (!PrivetUpdateClient(http_client.Pass())) + if (!PrivetUpdateClient(std::move(http_client))) return; StartPrivetLocalPrint(print_ticket, capabilities, page_size); diff --git a/chrome/browser/ui/webui/settings/font_handler.cc b/chrome/browser/ui/webui/settings/font_handler.cc index 4aee410..ff34281 100644 --- a/chrome/browser/ui/webui/settings/font_handler.cc +++ b/chrome/browser/ui/webui/settings/font_handler.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/settings/font_handler.h" #include <stddef.h> +#include <utility> #include "base/bind_helpers.h" #include "base/i18n/rtl.h" @@ -80,7 +81,7 @@ void FontHandler::FontListHasLoaded(scoped_ptr<base::ListValue> list) { // Add empty value to indicate a separator item. option->AppendString(std::string()); } - encoding_list.Append(option.Pass()); + encoding_list.Append(std::move(option)); } web_ui()->CallJavascriptFunction("Settings.setFontsData", *list, diff --git a/chrome/browser/ui/webui/settings/people_handler.cc b/chrome/browser/ui/webui/settings/people_handler.cc index c425b38..f180eb4 100644 --- a/chrome/browser/ui/webui/settings/people_handler.cc +++ b/chrome/browser/ui/webui/settings/people_handler.cc @@ -774,7 +774,7 @@ scoped_ptr<base::DictionaryValue> PeopleHandler::GetSyncStateDictionary() { // Cannot display signin status when running in guest mode on chromeos // because there is no SigninManager. sync_status->SetBoolean("signinAllowed", false); - return sync_status.Pass(); + return sync_status; } sync_status->SetBoolean("supervisedUser", profile_->IsSupervised()); @@ -821,7 +821,7 @@ scoped_ptr<base::DictionaryValue> PeopleHandler::GetSyncStateDictionary() { sync_status->SetString("name", name); sync_status->SetString("iconURL", icon_url); - return sync_status.Pass(); + return sync_status; } bool PeopleHandler::IsExistingWizardPresent() { diff --git a/chrome/browser/ui/webui/settings/reset_settings_handler.cc b/chrome/browser/ui/webui/settings/reset_settings_handler.cc index 38c7fef..238a006 100644 --- a/chrome/browser/ui/webui/settings/reset_settings_handler.cc +++ b/chrome/browser/ui/webui/settings/reset_settings_handler.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/settings/reset_settings_handler.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/metrics/histogram.h" @@ -199,10 +201,8 @@ void ResetSettingsHandler::ResetProfile(bool send_settings) { default_settings.reset(new BrandcodedDefaultSettings); GetResetter()->Reset( - ProfileResetter::ALL, - default_settings.Pass(), - base::Bind(&ResetSettingsHandler::OnResetProfileSettingsDone, - AsWeakPtr(), + ProfileResetter::ALL, std::move(default_settings), + base::Bind(&ResetSettingsHandler::OnResetProfileSettingsDone, AsWeakPtr(), send_settings)); content::RecordAction(base::UserMetricsAction("ResetProfile")); UMA_HISTOGRAM_BOOLEAN("ProfileReset.SendFeedback", send_settings); diff --git a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc index 03b1cce..e1d21ac 100644 --- a/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc +++ b/chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc @@ -445,10 +445,9 @@ class InlineLoginHelperBrowserTest : public InProcessBrowserTest { will_create_browser_context_services_subscription_ = BrowserContextDependencyManager::GetInstance() ->RegisterWillCreateBrowserContextServicesCallbackForTesting( - base::Bind(&InlineLoginHelperBrowserTest:: - OnWillCreateBrowserContextServices, - base::Unretained(this))) - .Pass(); + base::Bind(&InlineLoginHelperBrowserTest:: + OnWillCreateBrowserContextServices, + base::Unretained(this))); } void OnWillCreateBrowserContextServices(content::BrowserContext* context) { diff --git a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc index adc3c67..31a8d01 100644 --- a/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc +++ b/chrome/browser/ui/webui/supervised_user_internals_message_handler.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/supervised_user_internals_message_handler.h" +#include <utility> + #include "base/bind.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -34,8 +36,8 @@ base::ListValue* AddSection(base::ListValue* parent_list, section->SetString("title", title); // Grab a raw pointer to the result before |Pass()|ing it on. base::ListValue* result = section_contents.get(); - section->Set("data", section_contents.Pass()); - parent_list->Append(section.Pass()); + section->Set("data", std::move(section_contents)); + parent_list->Append(std::move(section)); return result; } @@ -47,7 +49,7 @@ void AddSectionEntry(base::ListValue* section_list, entry->SetString("stat_name", name); entry->SetBoolean("stat_value", value); entry->SetBoolean("is_valid", true); - section_list->Append(entry.Pass()); + section_list->Append(std::move(entry)); } // Adds a string entry to a section (created with |AddSection| above). @@ -58,7 +60,7 @@ void AddSectionEntry(base::ListValue* section_list, entry->SetString("stat_name", name); entry->SetString("stat_value", value); entry->SetBoolean("is_valid", true); - section_list->Append(entry.Pass()); + section_list->Append(std::move(entry)); } std::string FilteringBehaviorToString( @@ -264,7 +266,7 @@ void SupervisedUserInternalsMessageHandler::SendBasicInfo() { } base::DictionaryValue result; - result.Set("sections", section_list.Pass()); + result.Set("sections", std::move(section_list)); web_ui()->CallJavascriptFunction( "chrome.supervised_user_internals.receiveBasicInfo", result); diff --git a/chrome/browser/ui/webui/sync_internals_message_handler.cc b/chrome/browser/ui/webui/sync_internals_message_handler.cc index 8083711..bfcdd24 100644 --- a/chrome/browser/ui/webui/sync_internals_message_handler.cc +++ b/chrome/browser/ui/webui/sync_internals_message_handler.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/webui/sync_internals_message_handler.h" +#include <utility> #include <vector> #include "base/logging.h" @@ -45,7 +46,7 @@ SyncInternalsMessageHandler::SyncInternalsMessageHandler() SyncInternalsMessageHandler::SyncInternalsMessageHandler( scoped_ptr<AboutSyncDataExtractor> about_sync_data_extractor) - : about_sync_data_extractor_(about_sync_data_extractor.Pass()), + : about_sync_data_extractor_(std::move(about_sync_data_extractor)), weak_ptr_factory_(this) {} SyncInternalsMessageHandler::~SyncInternalsMessageHandler() { diff --git a/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc b/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc index b282873..d7a1ae4 100644 --- a/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_internals_message_handler_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/sync_internals_message_handler.h" +#include <utility> + #include "base/command_line.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -24,7 +26,7 @@ class TestableSyncInternalsMessageHandler : public SyncInternalsMessageHandler { explicit TestableSyncInternalsMessageHandler( content::WebUI* web_ui, scoped_ptr<AboutSyncDataExtractor> about_sync_data_extractor) - : SyncInternalsMessageHandler(about_sync_data_extractor.Pass()) { + : SyncInternalsMessageHandler(std::move(about_sync_data_extractor)) { set_web_ui(web_ui); } }; @@ -39,7 +41,7 @@ class FakeExtractor : public AboutSyncDataExtractor { last_signin_ = signin; scoped_ptr<base::DictionaryValue> dictionary(new base::DictionaryValue()); dictionary->SetString("fake_key", "fake_value"); - return dictionary.Pass(); + return dictionary; } int call_count() const { return call_count_; } diff --git a/chrome/browser/ui/webui/system_info_ui.cc b/chrome/browser/ui/webui/system_info_ui.cc index 3253a65..ca636a1 100644 --- a/chrome/browser/ui/webui/system_info_ui.cc +++ b/chrome/browser/ui/webui/system_info_ui.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/webui/system_info_ui.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/macros.h" @@ -117,7 +119,7 @@ void SystemInfoUIHTMLSource::StartDataRequest( void SystemInfoUIHTMLSource::SysInfoComplete( scoped_ptr<SystemLogsResponse> sys_info) { - response_ = sys_info.Pass(); + response_ = std::move(sys_info); RequestComplete(); } diff --git a/chrome/browser/ui/window_sizer/window_sizer.cc b/chrome/browser/ui/window_sizer/window_sizer.cc index ebc9e9a..051b162 100644 --- a/chrome/browser/ui/window_sizer/window_sizer.cc +++ b/chrome/browser/ui/window_sizer/window_sizer.cc @@ -4,6 +4,8 @@ #include "chrome/browser/ui/window_sizer/window_sizer.h" +#include <utility> + #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/macros.h" @@ -193,20 +195,19 @@ WindowSizer::WindowSizer( scoped_ptr<StateProvider> state_provider, scoped_ptr<TargetDisplayProvider> target_display_provider, const Browser* browser) - : state_provider_(state_provider.Pass()), - target_display_provider_(target_display_provider.Pass()), + : state_provider_(std::move(state_provider)), + target_display_provider_(std::move(target_display_provider)), // TODO(scottmg): NativeScreen is wrong. http://crbug.com/133312 screen_(gfx::Screen::GetNativeScreen()), - browser_(browser) { -} + browser_(browser) {} WindowSizer::WindowSizer( scoped_ptr<StateProvider> state_provider, scoped_ptr<TargetDisplayProvider> target_display_provider, gfx::Screen* screen, const Browser* browser) - : state_provider_(state_provider.Pass()), - target_display_provider_(target_display_provider.Pass()), + : state_provider_(std::move(state_provider)), + target_display_provider_(std::move(target_display_provider)), screen_(screen), browser_(browser) { DCHECK(screen_); @@ -226,9 +227,8 @@ void WindowSizer::GetBrowserWindowBoundsAndShowState( new DefaultStateProvider(app_name, browser)); scoped_ptr<TargetDisplayProvider> target_display_provider( new DefaultTargetDisplayProvider); - const WindowSizer sizer(state_provider.Pass(), - target_display_provider.Pass(), - browser); + const WindowSizer sizer(std::move(state_provider), + std::move(target_display_provider), browser); sizer.DetermineWindowBoundsAndShowState(specified_bounds, window_bounds, show_state); diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc index 95d19b2..3e03d81 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc @@ -43,7 +43,7 @@ scoped_ptr<Browser> CreateTestBrowser(aura::Window* window, ash::wm::GetWindowState(browser->window()->GetNativeWindow()) ->set_window_position_managed(true); } - return browser.Pass(); + return browser; } } // namespace diff --git a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc index 290ec59..38331da 100644 --- a/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc +++ b/chrome/browser/ui/window_sizer/window_sizer_common_unittest.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/window_sizer/window_sizer_common_unittest.h" #include <stddef.h> +#include <utility> #include "ash/wm/window_resizer.h" #include "base/compiler_specific.h" @@ -193,7 +194,7 @@ void GetWindowBoundsAndShowState( scoped_ptr<WindowSizer::TargetDisplayProvider> tdp( new TestTargetDisplayProvider); - WindowSizer sizer(sp.Pass(), tdp.Pass(), &test_screen, browser); + WindowSizer sizer(std::move(sp), std::move(tdp), &test_screen, browser); sizer.DetermineWindowBoundsAndShowState(passed_in, out_bounds, out_show_state); @@ -232,7 +233,7 @@ ui::WindowShowState GetWindowShowState( scoped_ptr<WindowSizer::TargetDisplayProvider> tdp( new TestTargetDisplayProvider); - WindowSizer sizer(sp.Pass(), tdp.Pass(), &test_screen, browser); + WindowSizer sizer(std::move(sp), std::move(tdp), &test_screen, browser); ui::WindowShowState out_show_state = ui::SHOW_STATE_DEFAULT; gfx::Rect out_bounds; |