OLD | NEW |
---|---|
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/options/cookies_view_handler.h" | 5 #include "chrome/browser/ui/webui/options/cookies_view_handler.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/browsing_data_appcache_helper.h" | 9 #include "chrome/browser/browsing_data_appcache_helper.h" |
10 #include "chrome/browser/browsing_data_cookie_helper.h" | |
10 #include "chrome/browser/browsing_data_database_helper.h" | 11 #include "chrome/browser/browsing_data_database_helper.h" |
11 #include "chrome/browser/browsing_data_file_system_helper.h" | 12 #include "chrome/browser/browsing_data_file_system_helper.h" |
12 #include "chrome/browser/browsing_data_indexed_db_helper.h" | 13 #include "chrome/browser/browsing_data_indexed_db_helper.h" |
13 #include "chrome/browser/browsing_data_local_storage_helper.h" | 14 #include "chrome/browser/browsing_data_local_storage_helper.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" | 16 #include "chrome/browser/ui/webui/cookies_tree_model_util.h" |
16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
17 #include "net/url_request/url_request_context_getter.h" | 18 #include "net/url_request/url_request_context_getter.h" |
erikwright (departed)
2011/07/21 19:24:36
Seems like this can be removed.
ycxiao
2011/07/21 21:17:15
Done.
| |
18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
19 | 20 |
20 CookiesViewHandler::CookiesViewHandler() : batch_update_(false) { | 21 CookiesViewHandler::CookiesViewHandler() : batch_update_(false) { |
21 } | 22 } |
22 | 23 |
23 CookiesViewHandler::~CookiesViewHandler() { | 24 CookiesViewHandler::~CookiesViewHandler() { |
24 } | 25 } |
25 | 26 |
26 void CookiesViewHandler::GetLocalizedValues( | 27 void CookiesViewHandler::GetLocalizedValues( |
27 DictionaryValue* localized_strings) { | 28 DictionaryValue* localized_strings) { |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 DCHECK(batch_update_); | 137 DCHECK(batch_update_); |
137 batch_update_ = false; | 138 batch_update_ = false; |
138 | 139 |
139 SendChildren(cookies_tree_model_->GetRoot()); | 140 SendChildren(cookies_tree_model_->GetRoot()); |
140 } | 141 } |
141 | 142 |
142 void CookiesViewHandler::EnsureCookiesTreeModelCreated() { | 143 void CookiesViewHandler::EnsureCookiesTreeModelCreated() { |
143 if (!cookies_tree_model_.get()) { | 144 if (!cookies_tree_model_.get()) { |
144 Profile* profile = web_ui_->GetProfile(); | 145 Profile* profile = web_ui_->GetProfile(); |
145 cookies_tree_model_.reset(new CookiesTreeModel( | 146 cookies_tree_model_.reset(new CookiesTreeModel( |
146 profile->GetRequestContext()->DONTUSEME_GetCookieStore()-> | 147 new BrowsingDataCookieHelper(profile), |
147 GetCookieMonster(), | |
148 new BrowsingDataDatabaseHelper(profile), | 148 new BrowsingDataDatabaseHelper(profile), |
149 new BrowsingDataLocalStorageHelper(profile), | 149 new BrowsingDataLocalStorageHelper(profile), |
150 NULL, | 150 NULL, |
151 new BrowsingDataAppCacheHelper(profile), | 151 new BrowsingDataAppCacheHelper(profile), |
152 BrowsingDataIndexedDBHelper::Create(profile), | 152 BrowsingDataIndexedDBHelper::Create(profile), |
153 BrowsingDataFileSystemHelper::Create(profile), | 153 BrowsingDataFileSystemHelper::Create(profile), |
154 false)); | 154 false)); |
155 cookies_tree_model_->AddCookiesTreeObserver(this); | 155 cookies_tree_model_->AddCookiesTreeObserver(this); |
156 } | 156 } |
157 } | 157 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
206 children); | 206 children); |
207 | 207 |
208 ListValue args; | 208 ListValue args; |
209 args.Append(parent == cookies_tree_model_->GetRoot() ? | 209 args.Append(parent == cookies_tree_model_->GetRoot() ? |
210 Value::CreateNullValue() : | 210 Value::CreateNullValue() : |
211 Value::CreateStringValue(cookies_tree_model_util::GetTreeNodeId(parent))); | 211 Value::CreateStringValue(cookies_tree_model_util::GetTreeNodeId(parent))); |
212 args.Append(children); | 212 args.Append(children); |
213 | 213 |
214 web_ui_->CallJavascriptFunction("CookiesView.loadChildren", args); | 214 web_ui_->CallJavascriptFunction("CookiesView.loadChildren", args); |
215 } | 215 } |
OLD | NEW |