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/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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ResourceBundle::GetSharedInstance().GetRawDataResource( | 122 ResourceBundle::GetSharedInstance().GetRawDataResource( |
123 IDR_COLLECTED_COOKIES_HTML)); | 123 IDR_COLLECTED_COOKIES_HTML)); |
124 std::string response = jstemplate_builder::GetI18nTemplateHtml( | 124 std::string response = jstemplate_builder::GetI18nTemplateHtml( |
125 html, &localized_strings); | 125 html, &localized_strings); |
126 | 126 |
127 SendResponse(request_id, base::RefCountedString::TakeString(&response)); | 127 SendResponse(request_id, base::RefCountedString::TakeString(&response)); |
128 } | 128 } |
129 | 129 |
130 } // namespace | 130 } // namespace |
131 | 131 |
| 132 namespace browser { |
| 133 |
| 134 // Declared in browser_dialogs.h so others don't have to depend on our header. |
| 135 void ShowCollectedCookiesDialog(gfx::NativeWindow parent_window, |
| 136 TabContents* tab_contents) { |
| 137 CollectedCookiesUIDelegate::Show(tab_contents); |
| 138 } |
| 139 |
| 140 } // namespace browser |
| 141 |
132 // static | 142 // static |
133 void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) { | 143 void CollectedCookiesUIDelegate::Show(TabContents* tab_contents) { |
134 CollectedCookiesUIDelegate* delegate = | 144 CollectedCookiesUIDelegate* delegate = |
135 new CollectedCookiesUIDelegate(tab_contents); | 145 new CollectedCookiesUIDelegate(tab_contents); |
136 Profile* profile = | 146 Profile* profile = |
137 Profile::FromBrowserContext(tab_contents->browser_context()); | 147 Profile::FromBrowserContext(tab_contents->browser_context()); |
138 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile, | 148 ConstrainedHtmlUI::CreateConstrainedHtmlDialog(profile, |
139 delegate, | 149 delegate, |
140 tab_contents); | 150 tab_contents); |
141 } | 151 } |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (!args->GetString(0, &node_path)) | 293 if (!args->GetString(0, &node_path)) |
284 return; | 294 return; |
285 | 295 |
286 CookieTreeOriginNode* origin_node = GetOriginNode( | 296 CookieTreeOriginNode* origin_node = GetOriginNode( |
287 blocked_cookies_tree_model_.get(), node_path); | 297 blocked_cookies_tree_model_.get(), node_path); |
288 if (!origin_node) | 298 if (!origin_node) |
289 return; | 299 return; |
290 | 300 |
291 AddContentException(origin_node, CONTENT_SETTING_SESSION_ONLY); | 301 AddContentException(origin_node, CONTENT_SETTING_SESSION_ONLY); |
292 } | 302 } |
OLD | NEW |