| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/flash_ui.h" | 5 #include "chrome/browser/ui/webui/flash_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 12 #include <utility> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/bind.h" | 15 #include "base/bind.h" |
| 14 #include "base/bind_helpers.h" | 16 #include "base/bind_helpers.h" |
| 15 #include "base/i18n/time_formatting.h" | 17 #include "base/i18n/time_formatting.h" |
| 16 #include "base/macros.h" | 18 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 18 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 19 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/stringprintf.h" | 22 #include "base/strings/stringprintf.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 182 } |
| 181 | 183 |
| 182 void FlashDOMHandler::OnUploadListAvailable() { | 184 void FlashDOMHandler::OnUploadListAvailable() { |
| 183 crash_list_available_ = true; | 185 crash_list_available_ = true; |
| 184 MaybeRespondToPage(); | 186 MaybeRespondToPage(); |
| 185 } | 187 } |
| 186 | 188 |
| 187 void AddPair(base::ListValue* list, | 189 void AddPair(base::ListValue* list, |
| 188 const base::string16& key, | 190 const base::string16& key, |
| 189 const base::string16& value) { | 191 const base::string16& value) { |
| 190 base::DictionaryValue* results = new base::DictionaryValue(); | 192 std::unique_ptr<base::DictionaryValue> results(new base::DictionaryValue()); |
| 191 results->SetString("key", key); | 193 results->SetString("key", key); |
| 192 results->SetString("value", value); | 194 results->SetString("value", value); |
| 193 list->Append(results); | 195 list->Append(std::move(results)); |
| 194 } | 196 } |
| 195 | 197 |
| 196 void AddPair(base::ListValue* list, | 198 void AddPair(base::ListValue* list, |
| 197 const base::string16& key, | 199 const base::string16& key, |
| 198 const std::string& value) { | 200 const std::string& value) { |
| 199 AddPair(list, key, ASCIIToUTF16(value)); | 201 AddPair(list, key, ASCIIToUTF16(value)); |
| 200 } | 202 } |
| 201 | 203 |
| 202 void FlashDOMHandler::HandleRequestFlashInfo(const base::ListValue* args) { | 204 void FlashDOMHandler::HandleRequestFlashInfo(const base::ListValue* args) { |
| 203 page_has_requested_data_ = true; | 205 page_has_requested_data_ = true; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 Profile* profile = Profile::FromWebUI(web_ui); | 396 Profile* profile = Profile::FromWebUI(web_ui); |
| 395 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); | 397 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); |
| 396 } | 398 } |
| 397 | 399 |
| 398 // static | 400 // static |
| 399 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( | 401 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( |
| 400 ui::ScaleFactor scale_factor) { | 402 ui::ScaleFactor scale_factor) { |
| 401 // Use the default icon for now. | 403 // Use the default icon for now. |
| 402 return NULL; | 404 return NULL; |
| 403 } | 405 } |
| OLD | NEW |