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

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

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase Created 9 years, 4 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/sessions_ui.h" 5 #include "chrome/browser/ui/webui/sessions_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sync/engine/syncapi.h" 10 #include "chrome/browser/sync/engine/syncapi.h"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 NewCallback(this, &SessionsDOMHandler::HandleRequestSessions)); 112 NewCallback(this, &SessionsDOMHandler::HandleRequestSessions));
113 } 113 }
114 114
115 void SessionsDOMHandler::HandleRequestSessions(const ListValue* args) { 115 void SessionsDOMHandler::HandleRequestSessions(const ListValue* args) {
116 UpdateUI(); 116 UpdateUI();
117 } 117 }
118 118
119 browser_sync::SessionModelAssociator* SessionsDOMHandler::GetModelAssociator() { 119 browser_sync::SessionModelAssociator* SessionsDOMHandler::GetModelAssociator() {
120 // We only want to get the model associator if there is one, and it is done 120 // We only want to get the model associator if there is one, and it is done
121 // syncing sessions. 121 // syncing sessions.
122 Profile* profile = web_ui_->GetProfile(); 122 Profile* profile = Profile::FromWebUI(web_ui_);
123 if (!profile->HasProfileSyncService()) 123 if (!profile->HasProfileSyncService())
124 return NULL; 124 return NULL;
125 ProfileSyncService* service = profile->GetProfileSyncService(); 125 ProfileSyncService* service = profile->GetProfileSyncService();
126 if (!service->ShouldPushChanges()) 126 if (!service->ShouldPushChanges())
127 return NULL; 127 return NULL;
128 return service->GetSessionModelAssociator(); 128 return service->GetSessionModelAssociator();
129 } 129 }
130 130
131 void SessionsDOMHandler::GetTabList( 131 void SessionsDOMHandler::GetTabList(
132 const std::vector<SessionTab*>& tabs, ListValue* tab_list) { 132 const std::vector<SessionTab*>& tabs, ListValue* tab_list) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 Profile* profile = Profile::FromBrowserContext(contents->browser_context()); 254 Profile* profile = Profile::FromBrowserContext(contents->browser_context());
255 profile->GetChromeURLDataManager()->AddDataSource( 255 profile->GetChromeURLDataManager()->AddDataSource(
256 CreateSessionsUIHTMLSource()); 256 CreateSessionsUIHTMLSource());
257 } 257 }
258 258
259 // static 259 // static
260 RefCountedMemory* SessionsUI::GetFaviconResourceBytes() { 260 RefCountedMemory* SessionsUI::GetFaviconResourceBytes() {
261 return ResourceBundle::GetSharedInstance(). 261 return ResourceBundle::GetSharedInstance().
262 LoadDataResourceBytes(IDR_HISTORY_FAVICON); 262 LoadDataResourceBytes(IDR_HISTORY_FAVICON);
263 } 263 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/quota_internals_handler.cc ('k') | chrome/browser/ui/webui/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698