| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/activity_log/fullstream_ui_policy.h" | 5 #include "chrome/browser/extensions/activity_log/fullstream_ui_policy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 while (query.is_valid() && query.Step()) { | 189 while (query.is_valid() && query.Step()) { |
| 190 scoped_refptr<Action> action = | 190 scoped_refptr<Action> action = |
| 191 new Action(query.ColumnString(0), | 191 new Action(query.ColumnString(0), |
| 192 base::Time::FromInternalValue(query.ColumnInt64(1)), | 192 base::Time::FromInternalValue(query.ColumnInt64(1)), |
| 193 static_cast<Action::ActionType>(query.ColumnInt(2)), | 193 static_cast<Action::ActionType>(query.ColumnInt(2)), |
| 194 query.ColumnString(3), query.ColumnInt64(9)); | 194 query.ColumnString(3), query.ColumnInt64(9)); |
| 195 | 195 |
| 196 if (query.ColumnType(4) != sql::COLUMN_TYPE_NULL) { | 196 if (query.ColumnType(4) != sql::COLUMN_TYPE_NULL) { |
| 197 std::unique_ptr<base::Value> parsed_value = | 197 std::unique_ptr<base::Value> parsed_value = |
| 198 base::JSONReader::Read(query.ColumnString(4)); | 198 base::JSONReader::Read(query.ColumnString(4)); |
| 199 if (parsed_value && parsed_value->IsType(base::Value::TYPE_LIST)) { | 199 if (parsed_value && parsed_value->IsType(base::Value::Type::LIST)) { |
| 200 action->set_args(base::WrapUnique( | 200 action->set_args(base::WrapUnique( |
| 201 static_cast<base::ListValue*>(parsed_value.release()))); | 201 static_cast<base::ListValue*>(parsed_value.release()))); |
| 202 } | 202 } |
| 203 } | 203 } |
| 204 | 204 |
| 205 action->ParsePageUrl(query.ColumnString(5)); | 205 action->ParsePageUrl(query.ColumnString(5)); |
| 206 action->set_page_title(query.ColumnString(6)); | 206 action->set_page_title(query.ColumnString(6)); |
| 207 action->ParseArgUrl(query.ColumnString(7)); | 207 action->ParseArgUrl(query.ColumnString(7)); |
| 208 | 208 |
| 209 if (query.ColumnType(8) != sql::COLUMN_TYPE_NULL) { | 209 if (query.ColumnType(8) != sql::COLUMN_TYPE_NULL) { |
| 210 std::unique_ptr<base::Value> parsed_value = | 210 std::unique_ptr<base::Value> parsed_value = |
| 211 base::JSONReader::Read(query.ColumnString(8)); | 211 base::JSONReader::Read(query.ColumnString(8)); |
| 212 if (parsed_value && parsed_value->IsType(base::Value::TYPE_DICTIONARY)) { | 212 if (parsed_value && parsed_value->IsType(base::Value::Type::DICTIONARY)) { |
| 213 action->set_other(base::WrapUnique( | 213 action->set_other(base::WrapUnique( |
| 214 static_cast<base::DictionaryValue*>(parsed_value.release()))); | 214 static_cast<base::DictionaryValue*>(parsed_value.release()))); |
| 215 } | 215 } |
| 216 } | 216 } |
| 217 actions->push_back(action); | 217 actions->push_back(action); |
| 218 } | 218 } |
| 219 | 219 |
| 220 return actions; | 220 return actions; |
| 221 } | 221 } |
| 222 | 222 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 443 } |
| 444 | 444 |
| 445 void FullStreamUIPolicy::QueueAction(scoped_refptr<Action> action) { | 445 void FullStreamUIPolicy::QueueAction(scoped_refptr<Action> action) { |
| 446 if (activity_database()->is_db_valid()) { | 446 if (activity_database()->is_db_valid()) { |
| 447 queued_actions_.push_back(action); | 447 queued_actions_.push_back(action); |
| 448 activity_database()->AdviseFlush(queued_actions_.size()); | 448 activity_database()->AdviseFlush(queued_actions_.size()); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 } // namespace extensions | 452 } // namespace extensions |
| OLD | NEW |