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

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

Issue 9188056: Start splitting out WebUI into an implementation class and an interface that each page implements... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
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/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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 << "been triggered"; 49 << "been triggered";
50 return "text/html"; 50 return "text/html";
51 } 51 }
52 52
53 //////////////////////////////////////////////////////////////////////////////// 53 ////////////////////////////////////////////////////////////////////////////////
54 // 54 //
55 // BookmarksUI 55 // BookmarksUI
56 // 56 //
57 //////////////////////////////////////////////////////////////////////////////// 57 ////////////////////////////////////////////////////////////////////////////////
58 58
59 BookmarksUI::BookmarksUI(WebContents* contents) : WebUI(contents) { 59 BookmarksUI::BookmarksUI(WebContents* contents) : WebUI(contents, this) {
60 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource(); 60 BookmarksUIHTMLSource* html_source = new BookmarksUIHTMLSource();
61 61
62 // Set up the chrome://bookmarks/ source. 62 // Set up the chrome://bookmarks/ source.
63 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 63 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
64 profile->GetChromeURLDataManager()->AddDataSource(html_source); 64 profile->GetChromeURLDataManager()->AddDataSource(html_source);
65 } 65 }
66 66
67 // static 67 // static
68 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() { 68 RefCountedMemory* BookmarksUI::GetFaviconResourceBytes() {
69 return ResourceBundle::GetSharedInstance(). 69 return ResourceBundle::GetSharedInstance().
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 base::Int64ToString(editId).c_str())); 106 base::Int64ToString(editId).c_str()));
107 107
108 // Invoke the WebUI bookmark editor to edit the specified bookmark. 108 // Invoke the WebUI bookmark editor to edit the specified bookmark.
109 Browser* browser = BrowserList::GetLastActiveWithProfile(profile); 109 Browser* browser = BrowserList::GetLastActiveWithProfile(profile);
110 DCHECK(browser); 110 DCHECK(browser);
111 browser::NavigateParams params( 111 browser::NavigateParams params(
112 browser->GetSingletonTabNavigateParams(url)); 112 browser->GetSingletonTabNavigateParams(url));
113 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE; 113 params.path_behavior = browser::NavigateParams::IGNORE_AND_NAVIGATE;
114 browser->ShowSingletonTabOverwritingNTP(params); 114 browser->ShowSingletonTabOverwritingNTP(params);
115 } 115 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/bookmarks_ui.h ('k') | chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698