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

Side by Side Diff: chrome/browser/ui/webui/sync_internals_ui.cc

Issue 10196004: Changed ChromeURLDataManager to a ProfileKeyedService and made a Factory for it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Made ChromeURLDataManager's destructor virtual Created 8 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/sync_internals_ui.h" 5 #include "chrome/browser/ui/webui/sync_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 profile->GetOriginalProfile()); 75 profile->GetOriginalProfile());
76 } 76 }
77 77
78 } // namespace 78 } // namespace
79 79
80 SyncInternalsUI::SyncInternalsUI(content::WebUI* web_ui) 80 SyncInternalsUI::SyncInternalsUI(content::WebUI* web_ui)
81 : WebUIController(web_ui), 81 : WebUIController(web_ui),
82 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 82 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
83 // TODO(akalin): Fix. 83 // TODO(akalin): Fix.
84 Profile* profile = Profile::FromWebUI(web_ui); 84 Profile* profile = Profile::FromWebUI(web_ui);
85 profile->GetChromeURLDataManager()->AddDataSource( 85 ChromeURLDataManager::AddDataSource(profile, CreateSyncInternalsHTMLSource());
86 CreateSyncInternalsHTMLSource());
87 ProfileSyncService* sync_service = GetProfileSyncService(profile); 86 ProfileSyncService* sync_service = GetProfileSyncService(profile);
88 if (sync_service) { 87 if (sync_service) {
89 js_controller_ = sync_service->GetJsController(); 88 js_controller_ = sync_service->GetJsController();
90 } 89 }
91 if (js_controller_.get()) { 90 if (js_controller_.get()) {
92 js_controller_->AddJsEventHandler(this); 91 js_controller_->AddJsEventHandler(this);
93 } 92 }
94 } 93 }
95 94
96 SyncInternalsUI::~SyncInternalsUI() { 95 SyncInternalsUI::~SyncInternalsUI() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 } 138 }
140 139
141 void SyncInternalsUI::HandleJsReply( 140 void SyncInternalsUI::HandleJsReply(
142 const std::string& name, const JsArgList& args) { 141 const std::string& name, const JsArgList& args) {
143 VLOG(1) << "Handling reply for " << name << " message with args " 142 VLOG(1) << "Handling reply for " << name << " message with args "
144 << args.ToString(); 143 << args.ToString();
145 const std::string& reply_handler = "chrome.sync." + name + ".handleReply"; 144 const std::string& reply_handler = "chrome.sync." + name + ".handleReply";
146 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); 145 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end());
147 web_ui()->CallJavascriptFunction(reply_handler, arg_list); 146 web_ui()->CallJavascriptFunction(reply_handler, arg_list);
148 } 147 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/sessions_ui.cc ('k') | chrome/browser/ui/webui/sync_promo/sync_promo_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698