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

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

Issue 7397021: Re-land r93365 - add RefCountedString (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 9 years, 5 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/collected_cookies_ui_delegate.h" 5 #include "chrome/browser/ui/webui/collected_cookies_ui_delegate.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 localized_strings.SetString("allowThisSessionButton", 114 localized_strings.SetString("allowThisSessionButton",
115 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON)); 115 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_SESSION_ONLY_BUTTON));
116 localized_strings.SetString("closeButton", 116 localized_strings.SetString("closeButton",
117 l10n_util::GetStringUTF16(IDS_CLOSE)); 117 l10n_util::GetStringUTF16(IDS_CLOSE));
118 118
119 SetFontAndTextDirection(&localized_strings); 119 SetFontAndTextDirection(&localized_strings);
120 120
121 static const base::StringPiece html( 121 static const base::StringPiece html(
122 ResourceBundle::GetSharedInstance().GetRawDataResource( 122 ResourceBundle::GetSharedInstance().GetRawDataResource(
123 IDR_COLLECTED_COOKIES_HTML)); 123 IDR_COLLECTED_COOKIES_HTML));
124 const std::string response = jstemplate_builder::GetI18nTemplateHtml( 124 std::string response = jstemplate_builder::GetI18nTemplateHtml(
125 html, &localized_strings); 125 html, &localized_strings);
126 126
127 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); 127 SendResponse(request_id, base::RefCountedString::TakeString(&response));
128 html_bytes->data.resize(response.size());
129 std::copy(response.begin(), response.end(), html_bytes->data.begin());
130
131 SendResponse(request_id, html_bytes);
132 } 128 }
133 129
134 } // namespace 130 } // namespace
135 131
136 // static 132 // static
137 void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) { 133 void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) {
138 CollectedCookiesUIDelegate* delegate = 134 CollectedCookiesUIDelegate* delegate =
139 new CollectedCookiesUIDelegate(tab_contents); 135 new CollectedCookiesUIDelegate(tab_contents);
140 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(tab_contents->profile(), 136 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(tab_contents->profile(),
141 delegate, 137 delegate,
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 if (!args->GetString(0, &node_path)) 279 if (!args->GetString(0, &node_path))
284 return; 280 return;
285 281
286 CookieTreeOriginNode* origin_node = GetOriginNode( 282 CookieTreeOriginNode* origin_node = GetOriginNode(
287 blocked_cookies_tree_model_.get(), node_path); 283 blocked_cookies_tree_model_.get(), node_path);
288 if (!origin_node) 284 if (!origin_node)
289 return; 285 return;
290 286
291 AddContentException(origin_node, CONTENT_SETTING_SESSION_ONLY); 287 AddContentException(origin_node, CONTENT_SETTING_SESSION_ONLY);
292 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/system_info_ui.cc ('k') | chrome/browser/ui/webui/extension_icon_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698