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

Side by Side Diff: chrome/browser/ui/webui/bookmarks_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: 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/bookmarks_ui.h" 5 #include "chrome/browser/ui/webui/bookmarks_ui.h"
6 6
7 #include "base/memory/ref_counted_memory.h" 7 #include "base/memory/ref_counted_memory.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
11 #include "base/stringprintf.h" 11 #include "base/stringprintf.h"
12 #include "chrome/browser/bookmarks/bookmark_editor.h" 12 #include "chrome/browser/bookmarks/bookmark_editor.h"
13 #include "chrome/browser/bookmarks/bookmark_model.h" 13 #include "chrome/browser/bookmarks/bookmark_model.h"
14 #include "chrome/browser/bookmarks/bookmark_utils.h" 14 #include "chrome/browser/bookmarks/bookmark_utils.h"
15 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
17 #include "chrome/browser/ui/browser_list.h" 17 #include "chrome/browser/ui/browser_list.h"
18 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 18 #include "chrome/browser/ui/webui/chrome_url_data_manager_factory.h"
19 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
20 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
21 #include "content/public/browser/web_ui.h" 21 #include "content/public/browser/web_ui.h"
22 #include "grit/theme_resources.h" 22 #include "grit/theme_resources.h"
23 #include "grit/theme_resources_standard.h" 23 #include "grit/theme_resources_standard.h"
24 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
25 #include "googleurl/src/gurl.h" 25 #include "googleurl/src/gurl.h"
26 26
27 using content::WebContents; 27 using content::WebContents;
28 28
(...skipping 26 matching lines...) Expand all
55 // 55 //
56 // BookmarksUI 56 // BookmarksUI
57 // 57 //
58 //////////////////////////////////////////////////////////////////////////////// 58 ////////////////////////////////////////////////////////////////////////////////
59 59
60 BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) { 60 BookmarksUI::BookmarksUI(content::WebUI* web_ui) : WebUIController(web_ui) {
61 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource(); 61 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource();
62 62
63 // Set up the chrome://bookmarks/ source. 63 // Set up the chrome://bookmarks/ source.
64 Profile* profile = Profile::FromWebUI(web_ui); 64 Profile* profile = Profile::FromWebUI(web_ui);
65 profile->GetChromeURLDataManager()->AddDataSource(html_source); 65 ChromeURLDataManagerFactory::GetForProfile(profile)->
66 AddDataSource(html_source);
66 } 67 }
67 68
68 // static 69 // static
69 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() { 70 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() {
70 return ResourceBundle::GetSharedInstance(). 71 return ResourceBundle::GetSharedInstance().
71 LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON); 72 LoadDataResourceBytes(IDR_BOOKMARKS_FAVICON);
72 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698