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

Unified Diff: chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc

Issue 1141843004: NTP Zombie Code Slayer II: Suggestions Page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: and remove urls Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc
diff --git a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc b/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc
deleted file mode 100644
index 020d441241b17a7da87c342d50a82ba8e8c5f463..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.h"
-
-#include "base/bind.h"
-#include "base/values.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/webui/ntp/suggestions_combiner.h"
-#include "content/public/browser/web_ui.h"
-
-namespace {
-
-const size_t kSuggestionsCount = 100;
-
-} // namespace
-
-SuggestionsInternalsUIHandler::SuggestionsInternalsUIHandler(Profile* profile)
- : profile_(profile) {}
-
-SuggestionsInternalsUIHandler::~SuggestionsInternalsUIHandler() {}
-
-void SuggestionsInternalsUIHandler::OnSuggestionsReady() {
- if (suggestions_combiner_->GetPageValues()) {
- web_ui()->CallJavascriptFunction("suggestionsInternals.setSuggestions",
- *suggestions_combiner_->GetPageValues());
- }
-}
-
-void SuggestionsInternalsUIHandler::RegisterMessages() {
- // Setup the suggestions sources.
- suggestions_combiner_.reset(new SuggestionsCombiner(this, profile_));
- suggestions_combiner_->SetSuggestionsCount(kSuggestionsCount);
- suggestions_combiner_->EnableDebug(true);
-
- web_ui()->RegisterMessageCallback("getSuggestions",
- base::Bind(&SuggestionsInternalsUIHandler::HandleGetSuggestions,
- base::Unretained(this)));
-}
-
-void SuggestionsInternalsUIHandler::HandleGetSuggestions(
- const base::ListValue* one_element_input_string) {
- suggestions_combiner_->FetchItems(Profile::FromWebUI(web_ui()));
-}
« no previous file with comments | « chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui_handler.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698