Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/ui/webui/options/home_page_overlay_handler.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/options/home_page_overlay_handler.h" 5 #include "chrome/browser/ui/webui/options/home_page_overlay_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/ptr_util.h"
9 #include "base/values.h" 10 #include "base/values.h"
10 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" 11 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
11 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 12 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
12 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/search_engines/template_url_service_factory.h" 14 #include "chrome/browser/search_engines/template_url_service_factory.h"
14 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
15 #include "components/metrics/proto/omnibox_event.pb.h" 16 #include "components/metrics/proto/omnibox_event.pb.h"
16 #include "components/omnibox/browser/autocomplete_classifier.h" 17 #include "components/omnibox/browser/autocomplete_classifier.h"
17 #include "components/omnibox/browser/autocomplete_controller.h" 18 #include "components/omnibox/browser/autocomplete_controller.h"
18 #include "components/omnibox/browser/autocomplete_input.h" 19 #include "components/omnibox/browser/autocomplete_input.h"
(...skipping 11 matching lines...) Expand all
30 void HomePageOverlayHandler::RegisterMessages() { 31 void HomePageOverlayHandler::RegisterMessages() {
31 web_ui()->RegisterMessageCallback( 32 web_ui()->RegisterMessageCallback(
32 "requestAutocompleteSuggestionsForHomePage", 33 "requestAutocompleteSuggestionsForHomePage",
33 base::Bind(&HomePageOverlayHandler::RequestAutocompleteSuggestions, 34 base::Bind(&HomePageOverlayHandler::RequestAutocompleteSuggestions,
34 base::Unretained(this))); 35 base::Unretained(this)));
35 } 36 }
36 37
37 void HomePageOverlayHandler::InitializeHandler() { 38 void HomePageOverlayHandler::InitializeHandler() {
38 Profile* profile = Profile::FromWebUI(web_ui()); 39 Profile* profile = Profile::FromWebUI(web_ui());
39 autocomplete_controller_.reset(new AutocompleteController( 40 autocomplete_controller_.reset(new AutocompleteController(
40 make_scoped_ptr(new ChromeAutocompleteProviderClient(profile)), this, 41 base::WrapUnique(new ChromeAutocompleteProviderClient(profile)), this,
41 AutocompleteClassifier::kDefaultOmniboxProviders)); 42 AutocompleteClassifier::kDefaultOmniboxProviders));
42 } 43 }
43 44
44 void HomePageOverlayHandler::GetLocalizedValues( 45 void HomePageOverlayHandler::GetLocalizedValues(
45 base::DictionaryValue* localized_strings) { 46 base::DictionaryValue* localized_strings) {
46 RegisterTitle(localized_strings, "homePageOverlay", 47 RegisterTitle(localized_strings, "homePageOverlay",
47 IDS_OPTIONS_HOMEPAGE_TITLE); 48 IDS_OPTIONS_HOMEPAGE_TITLE);
48 } 49 }
49 50
50 void HomePageOverlayHandler::RequestAutocompleteSuggestions( 51 void HomePageOverlayHandler::RequestAutocompleteSuggestions(
(...skipping 10 matching lines...) Expand all
61 62
62 void HomePageOverlayHandler::OnResultChanged(bool default_match_changed) { 63 void HomePageOverlayHandler::OnResultChanged(bool default_match_changed) {
63 const AutocompleteResult& result = autocomplete_controller_->result(); 64 const AutocompleteResult& result = autocomplete_controller_->result();
64 base::ListValue suggestions; 65 base::ListValue suggestions;
65 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions); 66 OptionsUI::ProcessAutocompleteSuggestions(result, &suggestions);
66 web_ui()->CallJavascriptFunction( 67 web_ui()->CallJavascriptFunction(
67 "HomePageOverlay.updateAutocompleteSuggestions", suggestions); 68 "HomePageOverlay.updateAutocompleteSuggestions", suggestions);
68 } 69 }
69 70
70 } // namespace options 71 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/home_page_overlay_handler.h ('k') | chrome/browser/ui/webui/options/import_data_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698