OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/dom_ui/sync_internals_ui.h" | 5 #include "chrome/browser/dom_ui/sync_internals_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/browser_thread.h" | 14 #include "chrome/browser/browser_thread.h" |
15 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" | |
16 #include "chrome/browser/dom_ui/sync_internals_html_source.h" | 15 #include "chrome/browser/dom_ui/sync_internals_html_source.h" |
17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/sync/js_arg_list.h" | 17 #include "chrome/browser/sync/js_arg_list.h" |
19 #include "chrome/browser/sync/js_frontend.h" | 18 #include "chrome/browser/sync/js_frontend.h" |
20 #include "chrome/browser/sync/profile_sync_service.h" | 19 #include "chrome/browser/sync/profile_sync_service.h" |
21 #include "chrome/browser/sync/sync_ui_util.h" | 20 #include "chrome/browser/sync/sync_ui_util.h" |
| 21 #include "chrome/browser/webui/chrome_url_data_manager.h" |
22 #include "chrome/common/render_messages_params.h" | 22 #include "chrome/common/render_messages_params.h" |
23 | 23 |
24 SyncInternalsUI::SyncInternalsUI(TabContents* contents) | 24 SyncInternalsUI::SyncInternalsUI(TabContents* contents) |
25 : WebUI(contents) { | 25 : WebUI(contents) { |
26 browser_sync::JsFrontend* backend = GetJsFrontend(); | 26 browser_sync::JsFrontend* backend = GetJsFrontend(); |
27 if (backend) { | 27 if (backend) { |
28 backend->AddHandler(this); | 28 backend->AddHandler(this); |
29 } | 29 } |
30 // If this PostTask() call fails, it's most likely because this is | 30 // If this PostTask() call fails, it's most likely because this is |
31 // being run from a unit test. The created objects will be cleaned | 31 // being run from a unit test. The created objects will be cleaned |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); | 74 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); |
75 CallJavascriptFunction(UTF8ToWide(name), arg_list); | 75 CallJavascriptFunction(UTF8ToWide(name), arg_list); |
76 } | 76 } |
77 | 77 |
78 browser_sync::JsFrontend* SyncInternalsUI::GetJsFrontend() { | 78 browser_sync::JsFrontend* SyncInternalsUI::GetJsFrontend() { |
79 // If this returns NULL that means that sync is disabled for | 79 // If this returns NULL that means that sync is disabled for |
80 // whatever reason. | 80 // whatever reason. |
81 ProfileSyncService* sync_service = GetProfile()->GetProfileSyncService(); | 81 ProfileSyncService* sync_service = GetProfile()->GetProfileSyncService(); |
82 return sync_service ? sync_service->GetJsFrontend() : NULL; | 82 return sync_service ? sync_service->GetJsFrontend() : NULL; |
83 } | 83 } |
OLD | NEW |