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

Unified Diff: chrome/browser/ui/webui/options/search_engine_manager_handler.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options/search_engine_manager_handler.cc
diff --git a/chrome/browser/ui/webui/options/search_engine_manager_handler.cc b/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
index 6186269d02026d4feba72cb0cffa959e9295f3e6..1a4e72e41b6b6d708f4ea8cf04a1b7f1422041c4 100644
--- a/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
+++ b/chrome/browser/ui/webui/options/search_engine_manager_handler.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/ui/search_engines/template_url_table_model.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
+#include "content/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"
#include "grit/locale_settings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -39,7 +40,9 @@ SearchEngineManagerHandler::~SearchEngineManagerHandler() {
}
void SearchEngineManagerHandler::Initialize() {
- list_controller_.reset(new KeywordEditorController(web_ui_->GetProfile()));
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ list_controller_.reset(new KeywordEditorController(profile));
if (list_controller_.get()) {
list_controller_->table_model()->SetObserver(this);
OnModelChanged();
@@ -134,8 +137,9 @@ void SearchEngineManagerHandler::OnModelChanged() {
// Build the extension keywords list.
ListValue keyword_list;
- ExtensionService* extension_service =
- web_ui_->GetProfile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
+ ExtensionService* extension_service = profile->GetExtensionService();
if (extension_service) {
const ExtensionList* extensions = extension_service->extensions();
for (ExtensionList::const_iterator it = extensions->begin();
@@ -241,8 +245,10 @@ void SearchEngineManagerHandler::EditSearchEngine(const ListValue* args) {
const TemplateURL* edit_url = NULL;
if (index != -1)
edit_url = list_controller_->GetTemplateURL(index);
+ Profile* profile =
+ Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
edit_controller_.reset(
- new EditSearchEngineController(edit_url, this, web_ui_->GetProfile()));
+ new EditSearchEngineController(edit_url, this, profile));
}
void SearchEngineManagerHandler::OnEditedKeyword(

Powered by Google App Engine
This is Rietveld 408576698