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

Side by Side Diff: chrome/browser/dom_ui/sync_internals_ui.cc

Issue 6461024: Revert 74292 - Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/slideshow_ui.cc ('k') | chrome/browser/dom_ui/textfields_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 12 matching lines...) Expand all
23 23
24 SyncInternalsUI::SyncInternalsUI(TabContents* contents) 24 SyncInternalsUI::SyncInternalsUI(TabContents* contents)
25 : DOMUI(contents) { 25 : DOMUI(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
32 // up, anyway. 32 // up, anyway.
33 contents->profile()->GetChromeURLDataManager()->AddDataSource( 33 (void)BrowserThread::PostTask(
34 new SyncInternalsHTMLSource()); 34 BrowserThread::IO, FROM_HERE,
35 NewRunnableMethod(
36 ChromeURLDataManager::GetInstance(),
37 &ChromeURLDataManager::AddDataSource,
38 make_scoped_refptr(new SyncInternalsHTMLSource())));
35 } 39 }
36 40
37 SyncInternalsUI::~SyncInternalsUI() { 41 SyncInternalsUI::~SyncInternalsUI() {
38 browser_sync::JsFrontend* backend = GetJsFrontend(); 42 browser_sync::JsFrontend* backend = GetJsFrontend();
39 if (backend) { 43 if (backend) {
40 backend->RemoveHandler(this); 44 backend->RemoveHandler(this);
41 } 45 }
42 } 46 }
43 47
44 void SyncInternalsUI::ProcessDOMUIMessage( 48 void SyncInternalsUI::ProcessDOMUIMessage(
(...skipping 29 matching lines...) Expand all
74 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); 78 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end());
75 CallJavascriptFunction(UTF8ToWide(name), arg_list); 79 CallJavascriptFunction(UTF8ToWide(name), arg_list);
76 } 80 }
77 81
78 browser_sync::JsFrontend* SyncInternalsUI::GetJsFrontend() { 82 browser_sync::JsFrontend* SyncInternalsUI::GetJsFrontend() {
79 // If this returns NULL that means that sync is disabled for 83 // If this returns NULL that means that sync is disabled for
80 // whatever reason. 84 // whatever reason.
81 ProfileSyncService* sync_service = GetProfile()->GetProfileSyncService(); 85 ProfileSyncService* sync_service = GetProfile()->GetProfileSyncService();
82 return sync_service ? sync_service->GetJsFrontend() : NULL; 86 return sync_service ? sync_service->GetJsFrontend() : NULL;
83 } 87 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/slideshow_ui.cc ('k') | chrome/browser/dom_ui/textfields_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698