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

Side by Side Diff: chrome/browser/ui/webui/sync_file_system_internals/dump_database_handler.cc

Issue 107743002: Add 'Dump Database' tab to syncfs-internals (only for v2 for now) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: regular -> Regular, added app_id Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/sync_file_system_internals/dump_database_handl er.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
9 #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h"
10 #include "content/public/browser/web_ui.h"
11 #include "content/public/browser/web_ui_data_source.h"
12
13 using sync_file_system::SyncFileSystemServiceFactory;
14
15 namespace syncfs_internals {
16
17 DumpDatabaseHandler::DumpDatabaseHandler(Profile* profile)
18 : profile_(profile) {}
19 DumpDatabaseHandler::~DumpDatabaseHandler() {}
20
21 void DumpDatabaseHandler::RegisterMessages() {
22 web_ui()->RegisterMessageCallback(
23 "getDatabaseDump",
24 base::Bind(&DumpDatabaseHandler::GetDatabaseDump,
25 base::Unretained(this)));
26 }
27
28 void DumpDatabaseHandler::GetDatabaseDump(const base::ListValue* args) {
29 scoped_ptr<base::ListValue> list =
30 SyncFileSystemServiceFactory::GetForProfile(profile_)->DumpDatabase();
31 web_ui()->CallJavascriptFunction("DumpDatabase.onGetDatabaseDump",
32 *list.get());
33 }
34
35 } // namespace syncfs_internals
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698