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

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 106433007: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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) 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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 break; 174 break;
175 } 175 }
176 } else { 176 } else {
177 NOTREACHED(); 177 NOTREACHED();
178 } 178 }
179 179
180 if (finished_tabs_.size() + crashed_tab_count_ >= outstanding_tab_count_) 180 if (finished_tabs_.size() + crashed_tab_count_ >= outstanding_tab_count_)
181 ConditionMet(); 181 ConditionMet();
182 } 182 }
183 183
184 DictionaryValue* InitialLoadObserver::GetTimingInformation() const { 184 base::DictionaryValue* InitialLoadObserver::GetTimingInformation() const {
185 ListValue* items = new ListValue; 185 base::ListValue* items = new base::ListValue;
186 for (TabTimeMap::const_iterator it = loading_tabs_.begin(); 186 for (TabTimeMap::const_iterator it = loading_tabs_.begin();
187 it != loading_tabs_.end(); 187 it != loading_tabs_.end();
188 ++it) { 188 ++it) {
189 DictionaryValue* item = new DictionaryValue; 189 base::DictionaryValue* item = new base::DictionaryValue;
190 base::TimeDelta delta_start = it->second.start_time() - init_time_; 190 base::TimeDelta delta_start = it->second.start_time() - init_time_;
191 191
192 item->SetDouble("load_start_ms", delta_start.InMillisecondsF()); 192 item->SetDouble("load_start_ms", delta_start.InMillisecondsF());
193 if (it->second.stop_time().is_null()) { 193 if (it->second.stop_time().is_null()) {
194 item->Set("load_stop_ms", Value::CreateNullValue()); 194 item->Set("load_stop_ms", base::Value::CreateNullValue());
195 } else { 195 } else {
196 base::TimeDelta delta_stop = it->second.stop_time() - init_time_; 196 base::TimeDelta delta_stop = it->second.stop_time() - init_time_;
197 item->SetDouble("load_stop_ms", delta_stop.InMillisecondsF()); 197 item->SetDouble("load_stop_ms", delta_stop.InMillisecondsF());
198 } 198 }
199 items->Append(item); 199 items->Append(item);
200 } 200 }
201 DictionaryValue* return_value = new DictionaryValue; 201 base::DictionaryValue* return_value = new base::DictionaryValue;
202 return_value->Set("tabs", items); 202 return_value->Set("tabs", items);
203 return return_value; 203 return return_value;
204 } 204 }
205 205
206 void InitialLoadObserver::ConditionMet() { 206 void InitialLoadObserver::ConditionMet() {
207 registrar_.RemoveAll(); 207 registrar_.RemoveAll();
208 if (automation_.get()) 208 if (automation_.get())
209 automation_->OnInitialTabLoadsComplete(); 209 automation_->OnInitialTabLoadsComplete();
210 } 210 }
211 211
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } else { 322 } else {
323 NOTREACHED(); 323 NOTREACHED();
324 } 324 }
325 } 325 }
326 326
327 void NavigationNotificationObserver::ConditionMet( 327 void NavigationNotificationObserver::ConditionMet(
328 AutomationMsg_NavigationResponseValues navigation_result) { 328 AutomationMsg_NavigationResponseValues navigation_result) {
329 if (automation_.get()) { 329 if (automation_.get()) {
330 if (use_json_interface_) { 330 if (use_json_interface_) {
331 if (navigation_result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { 331 if (navigation_result == AUTOMATION_MSG_NAVIGATION_SUCCESS) {
332 DictionaryValue dict; 332 base::DictionaryValue dict;
333 dict.SetInteger("result", navigation_result); 333 dict.SetInteger("result", navigation_result);
334 AutomationJSONReply(automation_.get(), reply_message_.release()) 334 AutomationJSONReply(automation_.get(), reply_message_.release())
335 .SendSuccess(&dict); 335 .SendSuccess(&dict);
336 } else { 336 } else {
337 AutomationJSONReply(automation_.get(), reply_message_.release()) 337 AutomationJSONReply(automation_.get(), reply_message_.release())
338 .SendError(base::StringPrintf( 338 .SendError(base::StringPrintf(
339 "Navigation failed with error code=%d.", navigation_result)); 339 "Navigation failed with error code=%d.", navigation_result));
340 } 340 }
341 } else { 341 } else {
342 IPC::ParamTraits<int>::Write( 342 IPC::ParamTraits<int>::Write(
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 const content::NotificationSource& source, 532 const content::NotificationSource& source,
533 const content::NotificationDetails& details) { 533 const content::NotificationDetails& details) {
534 if (!automation_.get()) { 534 if (!automation_.get()) {
535 delete this; 535 delete this;
536 return; 536 return;
537 } 537 }
538 538
539 switch (type) { 539 switch (type) {
540 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: { 540 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: {
541 if (id_ == content::Details<extensions::Extension>(details).ptr()->id()) { 541 if (id_ == content::Details<extensions::Extension>(details).ptr()->id()) {
542 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 542 scoped_ptr<base::DictionaryValue> return_value(
543 new base::DictionaryValue);
543 return_value->SetBoolean("success", true); 544 return_value->SetBoolean("success", true);
544 AutomationJSONReply(automation_.get(), reply_message_.release()) 545 AutomationJSONReply(automation_.get(), reply_message_.release())
545 .SendSuccess(return_value.get()); 546 .SendSuccess(return_value.get());
546 delete this; 547 delete this;
547 return; 548 return;
548 } 549 }
549 break; 550 break;
550 } 551 }
551 552
552 case chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED: { 553 case chrome::NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED: {
553 const extensions::Extension* extension = 554 const extensions::Extension* extension =
554 content::Details<extensions::Extension>(details).ptr(); 555 content::Details<extensions::Extension>(details).ptr();
555 if (id_ == extension->id()) { 556 if (id_ == extension->id()) {
556 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 557 scoped_ptr<base::DictionaryValue> return_value(
558 new base::DictionaryValue);
557 return_value->SetBoolean("success", false); 559 return_value->SetBoolean("success", false);
558 AutomationJSONReply(automation_.get(), reply_message_.release()) 560 AutomationJSONReply(automation_.get(), reply_message_.release())
559 .SendSuccess(return_value.get()); 561 .SendSuccess(return_value.get());
560 delete this; 562 delete this;
561 return; 563 return;
562 } 564 }
563 break; 565 break;
564 } 566 }
565 567
566 default: 568 default:
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: 635 case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR:
634 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED: 636 case chrome::NOTIFICATION_EXTENSION_UPDATE_DISABLED:
635 break; 637 break;
636 default: 638 default:
637 NOTREACHED(); 639 NOTREACHED();
638 break; 640 break;
639 } 641 }
640 642
641 AutomationJSONReply reply(automation_.get(), reply_message_.release()); 643 AutomationJSONReply reply(automation_.get(), reply_message_.release());
642 if (extension_) { 644 if (extension_) {
643 DictionaryValue dict; 645 base::DictionaryValue dict;
644 dict.SetString("id", extension_->id()); 646 dict.SetString("id", extension_->id());
645 reply.SendSuccess(&dict); 647 reply.SendSuccess(&dict);
646 } else { 648 } else {
647 reply.SendError("Extension could not be installed"); 649 reply.SendError("Extension could not be installed");
648 } 650 }
649 delete this; 651 delete this;
650 } 652 }
651 653
652 ExtensionUnloadNotificationObserver::ExtensionUnloadNotificationObserver() 654 ExtensionUnloadNotificationObserver::ExtensionUnloadNotificationObserver()
653 : did_receive_unload_notification_(false) { 655 : did_receive_unload_notification_(false) {
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 1046
1045 if (!automation_.get()) { 1047 if (!automation_.get()) {
1046 delete this; 1048 delete this;
1047 return; 1049 return;
1048 } 1050 }
1049 1051
1050 // We get multiple responses and one of those will contain the ordinal. 1052 // We get multiple responses and one of those will contain the ordinal.
1051 // This message comes to us before the final update is sent. 1053 // This message comes to us before the final update is sent.
1052 if (find_details->request_id() == kFindInPageRequestId) { 1054 if (find_details->request_id() == kFindInPageRequestId) {
1053 if (reply_with_json_) { 1055 if (reply_with_json_) {
1054 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1056 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
1055 return_value->SetInteger("match_count", 1057 return_value->SetInteger("match_count",
1056 find_details->number_of_matches()); 1058 find_details->number_of_matches());
1057 gfx::Rect rect = find_details->selection_rect(); 1059 gfx::Rect rect = find_details->selection_rect();
1058 // If MatchCount is > 0, then rect should not be Empty. 1060 // If MatchCount is > 0, then rect should not be Empty.
1059 // We dont guard it here because we want to let the test 1061 // We dont guard it here because we want to let the test
1060 // code catch this invalid case if needed. 1062 // code catch this invalid case if needed.
1061 if (!rect.IsEmpty()) { 1063 if (!rect.IsEmpty()) {
1062 return_value->SetInteger("match_left", rect.x()); 1064 return_value->SetInteger("match_left", rect.x());
1063 return_value->SetInteger("match_top", rect.y()); 1065 return_value->SetInteger("match_top", rect.y());
1064 return_value->SetInteger("match_right", rect.right()); 1066 return_value->SetInteger("match_right", rect.right());
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 reply_message_(reply_message), 1127 reply_message_(reply_message),
1126 use_json_interface_(use_json_interface) { 1128 use_json_interface_(use_json_interface) {
1127 } 1129 }
1128 1130
1129 DomOperationMessageSender::~DomOperationMessageSender() {} 1131 DomOperationMessageSender::~DomOperationMessageSender() {}
1130 1132
1131 void DomOperationMessageSender::OnDomOperationCompleted( 1133 void DomOperationMessageSender::OnDomOperationCompleted(
1132 const std::string& json) { 1134 const std::string& json) {
1133 if (automation_.get()) { 1135 if (automation_.get()) {
1134 if (use_json_interface_) { 1136 if (use_json_interface_) {
1135 DictionaryValue dict; 1137 base::DictionaryValue dict;
1136 dict.SetString("result", json); 1138 dict.SetString("result", json);
1137 AutomationJSONReply(automation_.get(), reply_message_.release()) 1139 AutomationJSONReply(automation_.get(), reply_message_.release())
1138 .SendSuccess(&dict); 1140 .SendSuccess(&dict);
1139 } else { 1141 } else {
1140 AutomationMsg_DomOperation::WriteReplyParams(reply_message_.get(), json); 1142 AutomationMsg_DomOperation::WriteReplyParams(reply_message_.get(), json);
1141 automation_->Send(reply_message_.release()); 1143 automation_->Send(reply_message_.release());
1142 } 1144 }
1143 } 1145 }
1144 delete this; 1146 delete this;
1145 } 1147 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 void AutomationProviderDownloadUpdatedObserver::OnDownloadUpdated( 1288 void AutomationProviderDownloadUpdatedObserver::OnDownloadUpdated(
1287 DownloadItem* download) { 1289 DownloadItem* download) {
1288 // If this observer is watching for open, only send the reply if the download 1290 // If this observer is watching for open, only send the reply if the download
1289 // has been auto-opened. 1291 // has been auto-opened.
1290 if (wait_for_open_ && !download->GetAutoOpened()) 1292 if (wait_for_open_ && !download->GetAutoOpened())
1291 return; 1293 return;
1292 1294
1293 download->RemoveObserver(this); 1295 download->RemoveObserver(this);
1294 1296
1295 if (provider_.get()) { 1297 if (provider_.get()) {
1296 scoped_ptr<DictionaryValue> return_value( 1298 scoped_ptr<base::DictionaryValue> return_value(
1297 provider_->GetDictionaryFromDownloadItem(download, incognito_)); 1299 provider_->GetDictionaryFromDownloadItem(download, incognito_));
1298 AutomationJSONReply(provider_.get(), reply_message_.release()) 1300 AutomationJSONReply(provider_.get(), reply_message_.release())
1299 .SendSuccess(return_value.get()); 1301 .SendSuccess(return_value.get());
1300 } 1302 }
1301 delete this; 1303 delete this;
1302 } 1304 }
1303 1305
1304 void AutomationProviderDownloadUpdatedObserver::OnDownloadOpened( 1306 void AutomationProviderDownloadUpdatedObserver::OnDownloadOpened(
1305 DownloadItem* download) { 1307 DownloadItem* download) {
1306 download->RemoveObserver(this); 1308 download->RemoveObserver(this);
1307 1309
1308 if (provider_.get()) { 1310 if (provider_.get()) {
1309 scoped_ptr<DictionaryValue> return_value( 1311 scoped_ptr<base::DictionaryValue> return_value(
1310 provider_->GetDictionaryFromDownloadItem(download, incognito_)); 1312 provider_->GetDictionaryFromDownloadItem(download, incognito_));
1311 AutomationJSONReply(provider_.get(), reply_message_.release()) 1313 AutomationJSONReply(provider_.get(), reply_message_.release())
1312 .SendSuccess(return_value.get()); 1314 .SendSuccess(return_value.get());
1313 } 1315 }
1314 delete this; 1316 delete this;
1315 } 1317 }
1316 1318
1317 AutomationProviderDownloadModelChangedObserver:: 1319 AutomationProviderDownloadModelChangedObserver::
1318 AutomationProviderDownloadModelChangedObserver( 1320 AutomationProviderDownloadModelChangedObserver(
1319 AutomationProvider* provider, 1321 AutomationProvider* provider,
(...skipping 21 matching lines...) Expand all
1341 1343
1342 void AutomationProviderDownloadModelChangedObserver::OnDownloadRemoved( 1344 void AutomationProviderDownloadModelChangedObserver::OnDownloadRemoved(
1343 DownloadManager* manager, DownloadItem* item) { 1345 DownloadManager* manager, DownloadItem* item) {
1344 ModelChanged(); 1346 ModelChanged();
1345 } 1347 }
1346 1348
1347 AllDownloadsCompleteObserver::AllDownloadsCompleteObserver( 1349 AllDownloadsCompleteObserver::AllDownloadsCompleteObserver(
1348 AutomationProvider* provider, 1350 AutomationProvider* provider,
1349 IPC::Message* reply_message, 1351 IPC::Message* reply_message,
1350 DownloadManager* download_manager, 1352 DownloadManager* download_manager,
1351 ListValue* pre_download_ids) 1353 base::ListValue* pre_download_ids)
1352 : provider_(provider->AsWeakPtr()), 1354 : provider_(provider->AsWeakPtr()),
1353 reply_message_(reply_message), 1355 reply_message_(reply_message),
1354 download_manager_(download_manager) { 1356 download_manager_(download_manager) {
1355 for (ListValue::iterator it = pre_download_ids->begin(); 1357 for (base::ListValue::iterator it = pre_download_ids->begin();
1356 it != pre_download_ids->end(); ++it) { 1358 it != pre_download_ids->end(); ++it) {
1357 int val = 0; 1359 int val = 0;
1358 if ((*it)->GetAsInteger(&val)) { 1360 if ((*it)->GetAsInteger(&val)) {
1359 pre_download_ids_.insert(val); 1361 pre_download_ids_.insert(val);
1360 } else { 1362 } else {
1361 AutomationJSONReply(provider_.get(), reply_message_.release()) 1363 AutomationJSONReply(provider_.get(), reply_message_.release())
1362 .SendError("Cannot convert ID of prior download to integer."); 1364 .SendError("Cannot convert ID of prior download to integer.");
1363 delete this; 1365 delete this;
1364 return; 1366 return;
1365 } 1367 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 AutomationProviderHistoryObserver::~AutomationProviderHistoryObserver() {} 1458 AutomationProviderHistoryObserver::~AutomationProviderHistoryObserver() {}
1457 1459
1458 void AutomationProviderHistoryObserver::HistoryQueryComplete( 1460 void AutomationProviderHistoryObserver::HistoryQueryComplete(
1459 HistoryService::Handle request_handle, 1461 HistoryService::Handle request_handle,
1460 history::QueryResults* results) { 1462 history::QueryResults* results) {
1461 if (!provider_.get()) { 1463 if (!provider_.get()) {
1462 delete this; 1464 delete this;
1463 return; 1465 return;
1464 } 1466 }
1465 1467
1466 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1468 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
1467 1469
1468 ListValue* history_list = new ListValue; 1470 base::ListValue* history_list = new base::ListValue;
1469 for (size_t i = 0; i < results->size(); ++i) { 1471 for (size_t i = 0; i < results->size(); ++i) {
1470 DictionaryValue* page_value = new DictionaryValue; 1472 base::DictionaryValue* page_value = new base::DictionaryValue;
1471 history::URLResult const &page = (*results)[i]; 1473 history::URLResult const &page = (*results)[i];
1472 page_value->SetString("title", page.title()); 1474 page_value->SetString("title", page.title());
1473 page_value->SetString("url", page.url().spec()); 1475 page_value->SetString("url", page.url().spec());
1474 page_value->SetDouble("time", 1476 page_value->SetDouble("time",
1475 static_cast<double>(page.visit_time().ToDoubleT())); 1477 static_cast<double>(page.visit_time().ToDoubleT()));
1476 page_value->SetString("snippet", page.snippet().text()); 1478 page_value->SetString("snippet", page.snippet().text());
1477 page_value->SetBoolean( 1479 page_value->SetBoolean(
1478 "starred", 1480 "starred",
1479 BookmarkModelFactory::GetForProfile( 1481 BookmarkModelFactory::GetForProfile(
1480 provider_->profile())->IsBookmarked(page.url())); 1482 provider_->profile())->IsBookmarked(page.url()));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
1528 ~AutomationProviderGetPasswordsObserver() {} 1530 ~AutomationProviderGetPasswordsObserver() {}
1529 1531
1530 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone( 1532 void AutomationProviderGetPasswordsObserver::OnPasswordStoreRequestDone(
1531 CancelableRequestProvider::Handle handle, 1533 CancelableRequestProvider::Handle handle,
1532 const std::vector<autofill::PasswordForm*>& result) { 1534 const std::vector<autofill::PasswordForm*>& result) {
1533 if (!provider_.get()) { 1535 if (!provider_.get()) {
1534 delete this; 1536 delete this;
1535 return; 1537 return;
1536 } 1538 }
1537 1539
1538 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1540 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
1539 1541
1540 ListValue* passwords = new ListValue; 1542 base::ListValue* passwords = new base::ListValue;
1541 for (std::vector<autofill::PasswordForm*>::const_iterator it = 1543 for (std::vector<autofill::PasswordForm*>::const_iterator it =
1542 result.begin(); it != result.end(); ++it) { 1544 result.begin(); it != result.end(); ++it) {
1543 DictionaryValue* password_val = new DictionaryValue; 1545 base::DictionaryValue* password_val = new base::DictionaryValue;
1544 autofill::PasswordForm* password_form = *it; 1546 autofill::PasswordForm* password_form = *it;
1545 password_val->SetString("username_value", password_form->username_value); 1547 password_val->SetString("username_value", password_form->username_value);
1546 password_val->SetString("password_value", password_form->password_value); 1548 password_val->SetString("password_value", password_form->password_value);
1547 password_val->SetString("signon_realm", password_form->signon_realm); 1549 password_val->SetString("signon_realm", password_form->signon_realm);
1548 password_val->SetDouble( 1550 password_val->SetDouble(
1549 "time", static_cast<double>(password_form->date_created.ToDoubleT())); 1551 "time", static_cast<double>(password_form->date_created.ToDoubleT()));
1550 password_val->SetString("origin_url", password_form->origin.spec()); 1552 password_val->SetString("origin_url", password_form->origin.spec());
1551 password_val->SetString("username_element", 1553 password_val->SetString("username_element",
1552 password_form->username_element); 1554 password_form->username_element);
1553 password_val->SetString("password_element", 1555 password_val->SetString("password_element",
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 base::Bind(&PasswordStoreLoginsChangedObserver::IndicateDone, this)); 1636 base::Bind(&PasswordStoreLoginsChangedObserver::IndicateDone, this));
1635 } 1637 }
1636 1638
1637 void PasswordStoreLoginsChangedObserver::IndicateDone() { 1639 void PasswordStoreLoginsChangedObserver::IndicateDone() {
1638 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1640 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1639 if (automation_.get()) { 1641 if (automation_.get()) {
1640 if (result_key_.empty()) { 1642 if (result_key_.empty()) {
1641 AutomationJSONReply(automation_.get(), reply_message_.release()) 1643 AutomationJSONReply(automation_.get(), reply_message_.release())
1642 .SendSuccess(NULL); 1644 .SendSuccess(NULL);
1643 } else { 1645 } else {
1644 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 1646 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
1645 return_value->SetBoolean(result_key_, true); 1647 return_value->SetBoolean(result_key_, true);
1646 AutomationJSONReply(automation_.get(), reply_message_.release()) 1648 AutomationJSONReply(automation_.get(), reply_message_.release())
1647 .SendSuccess(return_value.get()); 1649 .SendSuccess(return_value.get());
1648 } 1650 }
1649 } 1651 }
1650 Release(); 1652 Release();
1651 } 1653 }
1652 1654
1653 void PasswordStoreLoginsChangedObserver::IndicateError( 1655 void PasswordStoreLoginsChangedObserver::IndicateError(
1654 const std::string& error) { 1656 const std::string& error) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 void SavePackageNotificationObserver::ManagerGoingDown( 1719 void SavePackageNotificationObserver::ManagerGoingDown(
1718 content::DownloadManager* manager) { 1720 content::DownloadManager* manager) {
1719 delete this; 1721 delete this;
1720 } 1722 }
1721 1723
1722 namespace { 1724 namespace {
1723 1725
1724 // Returns a vector of dictionaries containing information about installed apps, 1726 // Returns a vector of dictionaries containing information about installed apps,
1725 // as identified from a given list of extensions. The caller takes ownership 1727 // as identified from a given list of extensions. The caller takes ownership
1726 // of the created vector. 1728 // of the created vector.
1727 std::vector<DictionaryValue*>* GetAppInfoFromExtensions( 1729 std::vector<base::DictionaryValue*>* GetAppInfoFromExtensions(
1728 const extensions::ExtensionSet* extensions, 1730 const extensions::ExtensionSet* extensions,
1729 ExtensionService* ext_service) { 1731 ExtensionService* ext_service) {
1730 std::vector<DictionaryValue*>* apps_list = 1732 std::vector<base::DictionaryValue*>* apps_list =
1731 new std::vector<DictionaryValue*>(); 1733 new std::vector<base::DictionaryValue*>();
1732 for (extensions::ExtensionSet::const_iterator ext = extensions->begin(); 1734 for (extensions::ExtensionSet::const_iterator ext = extensions->begin();
1733 ext != extensions->end(); ++ext) { 1735 ext != extensions->end(); ++ext) {
1734 // Only return information about extensions that are actually apps. 1736 // Only return information about extensions that are actually apps.
1735 if ((*ext)->is_app()) { 1737 if ((*ext)->is_app()) {
1736 DictionaryValue* app_info = new DictionaryValue(); 1738 base::DictionaryValue* app_info = new base::DictionaryValue();
1737 AppLauncherHandler::CreateAppInfo(ext->get(), ext_service, app_info); 1739 AppLauncherHandler::CreateAppInfo(ext->get(), ext_service, app_info);
1738 app_info->SetBoolean( 1740 app_info->SetBoolean(
1739 "is_component_extension", 1741 "is_component_extension",
1740 (*ext)->location() == extensions::Manifest::COMPONENT); 1742 (*ext)->location() == extensions::Manifest::COMPONENT);
1741 1743
1742 // Convert the launch_type integer into a more descriptive string. 1744 // Convert the launch_type integer into a more descriptive string.
1743 int launch_type; 1745 int launch_type;
1744 const char* kLaunchType = "launch_type"; 1746 const char* kLaunchType = "launch_type";
1745 if (!app_info->GetInteger(kLaunchType, &launch_type)) { 1747 if (!app_info->GetInteger(kLaunchType, &launch_type)) {
1746 NOTREACHED() << "Can't get integer from key " << kLaunchType; 1748 NOTREACHED() << "Can't get integer from key " << kLaunchType;
(...skipping 17 matching lines...) Expand all
1764 return apps_list; 1766 return apps_list;
1765 } 1767 }
1766 1768
1767 } // namespace 1769 } // namespace
1768 1770
1769 NTPInfoObserver::NTPInfoObserver(AutomationProvider* automation, 1771 NTPInfoObserver::NTPInfoObserver(AutomationProvider* automation,
1770 IPC::Message* reply_message) 1772 IPC::Message* reply_message)
1771 : automation_(automation->AsWeakPtr()), 1773 : automation_(automation->AsWeakPtr()),
1772 reply_message_(reply_message), 1774 reply_message_(reply_message),
1773 request_(0), 1775 request_(0),
1774 ntp_info_(new DictionaryValue) { 1776 ntp_info_(new base::DictionaryValue) {
1775 top_sites_ = automation_->profile()->GetTopSites(); 1777 top_sites_ = automation_->profile()->GetTopSites();
1776 if (!top_sites_) { 1778 if (!top_sites_) {
1777 AutomationJSONReply(automation_.get(), reply_message_.release()) 1779 AutomationJSONReply(automation_.get(), reply_message_.release())
1778 .SendError("Profile does not have service for querying the top sites."); 1780 .SendError("Profile does not have service for querying the top sites.");
1779 return; 1781 return;
1780 } 1782 }
1781 TabRestoreService* service = 1783 TabRestoreService* service =
1782 TabRestoreServiceFactory::GetForProfile(automation_->profile()); 1784 TabRestoreServiceFactory::GetForProfile(automation_->profile());
1783 if (!service) { 1785 if (!service) {
1784 AutomationJSONReply(automation_.get(), reply_message_.release()) 1786 AutomationJSONReply(automation_.get(), reply_message_.release())
1785 .SendError("No TabRestoreService."); 1787 .SendError("No TabRestoreService.");
1786 return; 1788 return;
1787 } 1789 }
1788 1790
1789 // Collect information about the apps in the new tab page. 1791 // Collect information about the apps in the new tab page.
1790 ExtensionService* ext_service = extensions::ExtensionSystem::Get( 1792 ExtensionService* ext_service = extensions::ExtensionSystem::Get(
1791 automation_->profile())->extension_service(); 1793 automation_->profile())->extension_service();
1792 if (!ext_service) { 1794 if (!ext_service) {
1793 AutomationJSONReply(automation_.get(), reply_message_.release()) 1795 AutomationJSONReply(automation_.get(), reply_message_.release())
1794 .SendError("No ExtensionService."); 1796 .SendError("No ExtensionService.");
1795 return; 1797 return;
1796 } 1798 }
1797 // Process enabled extensions. 1799 // Process enabled extensions.
1798 ListValue* apps_list = new ListValue(); 1800 base::ListValue* apps_list = new base::ListValue();
1799 const extensions::ExtensionSet* extensions = ext_service->extensions(); 1801 const extensions::ExtensionSet* extensions = ext_service->extensions();
1800 std::vector<DictionaryValue*>* enabled_apps = GetAppInfoFromExtensions( 1802 std::vector<base::DictionaryValue*>* enabled_apps = GetAppInfoFromExtensions(
1801 extensions, ext_service); 1803 extensions, ext_service);
1802 for (std::vector<DictionaryValue*>::const_iterator app = 1804 for (std::vector<base::DictionaryValue*>::const_iterator app =
1803 enabled_apps->begin(); app != enabled_apps->end(); ++app) { 1805 enabled_apps->begin(); app != enabled_apps->end(); ++app) {
1804 (*app)->SetBoolean("is_disabled", false); 1806 (*app)->SetBoolean("is_disabled", false);
1805 apps_list->Append(*app); 1807 apps_list->Append(*app);
1806 } 1808 }
1807 delete enabled_apps; 1809 delete enabled_apps;
1808 // Process disabled extensions. 1810 // Process disabled extensions.
1809 const extensions::ExtensionSet* disabled_extensions = 1811 const extensions::ExtensionSet* disabled_extensions =
1810 ext_service->disabled_extensions(); 1812 ext_service->disabled_extensions();
1811 std::vector<DictionaryValue*>* disabled_apps = GetAppInfoFromExtensions( 1813 std::vector<base::DictionaryValue*>* disabled_apps = GetAppInfoFromExtensions(
1812 disabled_extensions, ext_service); 1814 disabled_extensions, ext_service);
1813 for (std::vector<DictionaryValue*>::const_iterator app = 1815 for (std::vector<base::DictionaryValue*>::const_iterator app =
1814 disabled_apps->begin(); app != disabled_apps->end(); ++app) { 1816 disabled_apps->begin(); app != disabled_apps->end(); ++app) {
1815 (*app)->SetBoolean("is_disabled", true); 1817 (*app)->SetBoolean("is_disabled", true);
1816 apps_list->Append(*app); 1818 apps_list->Append(*app);
1817 } 1819 }
1818 delete disabled_apps; 1820 delete disabled_apps;
1819 // Process terminated extensions. 1821 // Process terminated extensions.
1820 const extensions::ExtensionSet* terminated_extensions = 1822 const extensions::ExtensionSet* terminated_extensions =
1821 ext_service->terminated_extensions(); 1823 ext_service->terminated_extensions();
1822 std::vector<DictionaryValue*>* terminated_apps = GetAppInfoFromExtensions( 1824 std::vector<base::DictionaryValue*>* terminated_apps =
1823 terminated_extensions, ext_service); 1825 GetAppInfoFromExtensions(terminated_extensions, ext_service);
1824 for (std::vector<DictionaryValue*>::const_iterator app = 1826 for (std::vector<base::DictionaryValue*>::const_iterator app =
1825 terminated_apps->begin(); app != terminated_apps->end(); ++app) { 1827 terminated_apps->begin(); app != terminated_apps->end(); ++app) {
1826 (*app)->SetBoolean("is_disabled", true); 1828 (*app)->SetBoolean("is_disabled", true);
1827 apps_list->Append(*app); 1829 apps_list->Append(*app);
1828 } 1830 }
1829 delete terminated_apps; 1831 delete terminated_apps;
1830 ntp_info_->Set("apps", apps_list); 1832 ntp_info_->Set("apps", apps_list);
1831 1833
1832 // Get the info that would be displayed in the recently closed section. 1834 // Get the info that would be displayed in the recently closed section.
1833 ListValue* recently_closed_list = new ListValue; 1835 base::ListValue* recently_closed_list = new base::ListValue;
1834 RecentlyClosedTabsHandler::CreateRecentlyClosedValues(service->entries(), 1836 RecentlyClosedTabsHandler::CreateRecentlyClosedValues(service->entries(),
1835 recently_closed_list); 1837 recently_closed_list);
1836 ntp_info_->Set("recently_closed", recently_closed_list); 1838 ntp_info_->Set("recently_closed", recently_closed_list);
1837 1839
1838 // Add default site URLs. 1840 // Add default site URLs.
1839 ListValue* default_sites_list = new ListValue; 1841 base::ListValue* default_sites_list = new base::ListValue;
1840 history::MostVisitedURLList urls = top_sites_->GetPrepopulatePages(); 1842 history::MostVisitedURLList urls = top_sites_->GetPrepopulatePages();
1841 for (size_t i = 0; i < urls.size(); ++i) { 1843 for (size_t i = 0; i < urls.size(); ++i) {
1842 default_sites_list->Append(Value::CreateStringValue( 1844 default_sites_list->Append(base::Value::CreateStringValue(
1843 urls[i].url.possibly_invalid_spec())); 1845 urls[i].url.possibly_invalid_spec()));
1844 } 1846 }
1845 ntp_info_->Set("default_sites", default_sites_list); 1847 ntp_info_->Set("default_sites", default_sites_list);
1846 1848
1847 registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_UPDATED, 1849 registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_UPDATED,
1848 content::Source<history::TopSites>(top_sites_)); 1850 content::Source<history::TopSites>(top_sites_));
1849 if (top_sites_->loaded()) { 1851 if (top_sites_->loaded()) {
1850 OnTopSitesLoaded(); 1852 OnTopSitesLoaded();
1851 } else { 1853 } else {
1852 registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_LOADED, 1854 registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_LOADED,
(...skipping 23 matching lines...) Expand all
1876 request_ = top_sites_->StartQueryForMostVisited(); 1878 request_ = top_sites_->StartQueryForMostVisited();
1877 } 1879 }
1878 1880
1879 void NTPInfoObserver::OnTopSitesReceived( 1881 void NTPInfoObserver::OnTopSitesReceived(
1880 const history::MostVisitedURLList& visited_list) { 1882 const history::MostVisitedURLList& visited_list) {
1881 if (!automation_.get()) { 1883 if (!automation_.get()) {
1882 delete this; 1884 delete this;
1883 return; 1885 return;
1884 } 1886 }
1885 1887
1886 ListValue* list_value = new ListValue; 1888 base::ListValue* list_value = new base::ListValue;
1887 for (size_t i = 0; i < visited_list.size(); ++i) { 1889 for (size_t i = 0; i < visited_list.size(); ++i) {
1888 const history::MostVisitedURL& visited = visited_list[i]; 1890 const history::MostVisitedURL& visited = visited_list[i];
1889 if (visited.url.spec().empty()) 1891 if (visited.url.spec().empty())
1890 break; // This is the signal that there are no more real visited sites. 1892 break; // This is the signal that there are no more real visited sites.
1891 DictionaryValue* dict = new DictionaryValue; 1893 base::DictionaryValue* dict = new base::DictionaryValue;
1892 dict->SetString("url", visited.url.spec()); 1894 dict->SetString("url", visited.url.spec());
1893 dict->SetString("title", visited.title); 1895 dict->SetString("title", visited.title);
1894 list_value->Append(dict); 1896 list_value->Append(dict);
1895 } 1897 }
1896 ntp_info_->Set("most_visited", list_value); 1898 ntp_info_->Set("most_visited", list_value);
1897 AutomationJSONReply(automation_.get(), reply_message_.release()) 1899 AutomationJSONReply(automation_.get(), reply_message_.release())
1898 .SendSuccess(ntp_info_.get()); 1900 .SendSuccess(ntp_info_.get());
1899 delete this; 1901 delete this;
1900 } 1902 }
1901 1903
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1988 if (!automation_.get()) { 1990 if (!automation_.get()) {
1989 delete this; 1991 delete this;
1990 return; 1992 return;
1991 } 1993 }
1992 if (AreActiveNotificationProcessesReady()) 1994 if (AreActiveNotificationProcessesReady())
1993 SendMessage(); 1995 SendMessage();
1994 } 1996 }
1995 1997
1996 base::DictionaryValue* GetAllNotificationsObserver::NotificationToJson( 1998 base::DictionaryValue* GetAllNotificationsObserver::NotificationToJson(
1997 const Notification* note) { 1999 const Notification* note) {
1998 DictionaryValue* dict = new base::DictionaryValue(); 2000 base::DictionaryValue* dict = new base::DictionaryValue();
1999 dict->SetString("content_url", note->content_url().spec()); 2001 dict->SetString("content_url", note->content_url().spec());
2000 dict->SetString("origin_url", note->origin_url().spec()); 2002 dict->SetString("origin_url", note->origin_url().spec());
2001 dict->SetString("display_source", note->display_source()); 2003 dict->SetString("display_source", note->display_source());
2002 dict->SetString("id", note->notification_id()); 2004 dict->SetString("id", note->notification_id());
2003 return dict; 2005 return dict;
2004 } 2006 }
2005 2007
2006 void GetAllNotificationsObserver::SendMessage() { 2008 void GetAllNotificationsObserver::SendMessage() {
2007 BalloonNotificationUIManager* manager = 2009 BalloonNotificationUIManager* manager =
2008 BalloonNotificationUIManager::GetInstanceForTesting(); 2010 BalloonNotificationUIManager::GetInstanceForTesting();
2009 const BalloonCollection::Balloons& balloons = 2011 const BalloonCollection::Balloons& balloons =
2010 manager->balloon_collection()->GetActiveBalloons(); 2012 manager->balloon_collection()->GetActiveBalloons();
2011 DictionaryValue return_value; 2013 base::DictionaryValue return_value;
2012 ListValue* list = new ListValue; 2014 base::ListValue* list = new base::ListValue;
2013 return_value.Set("notifications", list); 2015 return_value.Set("notifications", list);
2014 BalloonCollection::Balloons::const_iterator balloon_iter; 2016 BalloonCollection::Balloons::const_iterator balloon_iter;
2015 for (balloon_iter = balloons.begin(); balloon_iter != balloons.end(); 2017 for (balloon_iter = balloons.begin(); balloon_iter != balloons.end();
2016 ++balloon_iter) { 2018 ++balloon_iter) {
2017 base::DictionaryValue* note = NotificationToJson( 2019 base::DictionaryValue* note = NotificationToJson(
2018 &(*balloon_iter)->notification()); 2020 &(*balloon_iter)->notification());
2019 BalloonHost* balloon_host = (*balloon_iter)->balloon_view()->GetHost(); 2021 BalloonHost* balloon_host = (*balloon_iter)->balloon_view()->GetHost();
2020 if (balloon_host) { 2022 if (balloon_host) {
2021 int pid = base::GetProcId(balloon_host->web_contents()-> 2023 int pid = base::GetProcId(balloon_host->web_contents()->
2022 GetRenderViewHost()->GetProcess()->GetHandle()); 2024 GetRenderViewHost()->GetProcess()->GetHandle());
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 2288
2287 ProcessInfoObserver::ProcessInfoObserver( 2289 ProcessInfoObserver::ProcessInfoObserver(
2288 AutomationProvider* automation, 2290 AutomationProvider* automation,
2289 IPC::Message* reply_message) 2291 IPC::Message* reply_message)
2290 : automation_(automation->AsWeakPtr()), 2292 : automation_(automation->AsWeakPtr()),
2291 reply_message_(reply_message) {} 2293 reply_message_(reply_message) {}
2292 2294
2293 ProcessInfoObserver::~ProcessInfoObserver() {} 2295 ProcessInfoObserver::~ProcessInfoObserver() {}
2294 2296
2295 void ProcessInfoObserver::OnDetailsAvailable() { 2297 void ProcessInfoObserver::OnDetailsAvailable() {
2296 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 2298 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
2297 ListValue* browser_proc_list = new ListValue(); 2299 base::ListValue* browser_proc_list = new base::ListValue();
2298 const std::vector<ProcessData>& all_processes = processes(); 2300 const std::vector<ProcessData>& all_processes = processes();
2299 for (size_t index = 0; index < all_processes.size(); ++index) { 2301 for (size_t index = 0; index < all_processes.size(); ++index) {
2300 DictionaryValue* browser_data = new DictionaryValue(); 2302 base::DictionaryValue* browser_data = new base::DictionaryValue();
2301 browser_data->SetString("name", all_processes[index].name); 2303 browser_data->SetString("name", all_processes[index].name);
2302 browser_data->SetString("process_name", all_processes[index].process_name); 2304 browser_data->SetString("process_name", all_processes[index].process_name);
2303 2305
2304 ListValue* proc_list = new ListValue(); 2306 base::ListValue* proc_list = new base::ListValue();
2305 for (ProcessMemoryInformationList::const_iterator iterator = 2307 for (ProcessMemoryInformationList::const_iterator iterator =
2306 all_processes[index].processes.begin(); 2308 all_processes[index].processes.begin();
2307 iterator != all_processes[index].processes.end(); ++iterator) { 2309 iterator != all_processes[index].processes.end(); ++iterator) {
2308 DictionaryValue* proc_data = new DictionaryValue(); 2310 base::DictionaryValue* proc_data = new base::DictionaryValue();
2309 2311
2310 proc_data->SetInteger("pid", iterator->pid); 2312 proc_data->SetInteger("pid", iterator->pid);
2311 2313
2312 // Working set (resident) memory usage, in KBytes. 2314 // Working set (resident) memory usage, in KBytes.
2313 DictionaryValue* working_set = new DictionaryValue(); 2315 base::DictionaryValue* working_set = new base::DictionaryValue();
2314 working_set->SetInteger("priv", iterator->working_set.priv); 2316 working_set->SetInteger("priv", iterator->working_set.priv);
2315 working_set->SetInteger("shareable", iterator->working_set.shareable); 2317 working_set->SetInteger("shareable", iterator->working_set.shareable);
2316 working_set->SetInteger("shared", iterator->working_set.shared); 2318 working_set->SetInteger("shared", iterator->working_set.shared);
2317 proc_data->Set("working_set_mem", working_set); 2319 proc_data->Set("working_set_mem", working_set);
2318 2320
2319 // Committed (resident + paged) memory usage, in KBytes. 2321 // Committed (resident + paged) memory usage, in KBytes.
2320 DictionaryValue* committed = new DictionaryValue(); 2322 base::DictionaryValue* committed = new base::DictionaryValue();
2321 committed->SetInteger("priv", iterator->committed.priv); 2323 committed->SetInteger("priv", iterator->committed.priv);
2322 committed->SetInteger("mapped", iterator->committed.mapped); 2324 committed->SetInteger("mapped", iterator->committed.mapped);
2323 committed->SetInteger("image", iterator->committed.image); 2325 committed->SetInteger("image", iterator->committed.image);
2324 proc_data->Set("committed_mem", committed); 2326 proc_data->Set("committed_mem", committed);
2325 2327
2326 proc_data->SetString("version", iterator->version); 2328 proc_data->SetString("version", iterator->version);
2327 proc_data->SetString("product_name", iterator->product_name); 2329 proc_data->SetString("product_name", iterator->product_name);
2328 proc_data->SetInteger("num_processes", iterator->num_processes); 2330 proc_data->SetInteger("num_processes", iterator->num_processes);
2329 proc_data->SetBoolean("is_diagnostics", iterator->is_diagnostics); 2331 proc_data->SetBoolean("is_diagnostics", iterator->is_diagnostics);
2330 2332
(...skipping 10 matching lines...) Expand all
2341 // Renderer type, if this is a renderer process. 2343 // Renderer type, if this is a renderer process.
2342 std::string renderer_type = "Unknown"; 2344 std::string renderer_type = "Unknown";
2343 if (iterator->renderer_type != 2345 if (iterator->renderer_type !=
2344 ProcessMemoryInformation::RENDERER_UNKNOWN) { 2346 ProcessMemoryInformation::RENDERER_UNKNOWN) {
2345 renderer_type = ProcessMemoryInformation::GetRendererTypeNameInEnglish( 2347 renderer_type = ProcessMemoryInformation::GetRendererTypeNameInEnglish(
2346 iterator->renderer_type); 2348 iterator->renderer_type);
2347 } 2349 }
2348 proc_data->SetString("renderer_type", renderer_type); 2350 proc_data->SetString("renderer_type", renderer_type);
2349 2351
2350 // Titles associated with this process. 2352 // Titles associated with this process.
2351 ListValue* titles = new ListValue(); 2353 base::ListValue* titles = new base::ListValue();
2352 for (size_t title_index = 0; title_index < iterator->titles.size(); 2354 for (size_t title_index = 0; title_index < iterator->titles.size();
2353 ++title_index) 2355 ++title_index) {
2354 titles->Append(Value::CreateStringValue(iterator->titles[title_index])); 2356 titles->Append(
2357 base::Value::CreateStringValue(iterator->titles[title_index]));
2358 }
2355 proc_data->Set("titles", titles); 2359 proc_data->Set("titles", titles);
2356 2360
2357 proc_list->Append(proc_data); 2361 proc_list->Append(proc_data);
2358 } 2362 }
2359 browser_data->Set("processes", proc_list); 2363 browser_data->Set("processes", proc_list);
2360 2364
2361 browser_proc_list->Append(browser_data); 2365 browser_proc_list->Append(browser_data);
2362 } 2366 }
2363 return_value->Set("browsers", browser_proc_list); 2367 return_value->Set("browsers", browser_proc_list);
2364 2368
(...skipping 26 matching lines...) Expand all
2391 2395
2392 base::ProcessId updated_renderer_id = 2396 base::ProcessId updated_renderer_id =
2393 *(content::Source<base::ProcessId>(source).ptr()); 2397 *(content::Source<base::ProcessId>(source).ptr());
2394 // Only return information for the renderer ID we're interested in. 2398 // Only return information for the renderer ID we're interested in.
2395 if (renderer_id_ != updated_renderer_id) 2399 if (renderer_id_ != updated_renderer_id)
2396 return; 2400 return;
2397 2401
2398 ChromeRenderMessageFilter::V8HeapStatsDetails* v8_heap_details = 2402 ChromeRenderMessageFilter::V8HeapStatsDetails* v8_heap_details =
2399 content::Details<ChromeRenderMessageFilter::V8HeapStatsDetails>(details) 2403 content::Details<ChromeRenderMessageFilter::V8HeapStatsDetails>(details)
2400 .ptr(); 2404 .ptr();
2401 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 2405 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
2402 return_value->SetInteger("renderer_id", updated_renderer_id); 2406 return_value->SetInteger("renderer_id", updated_renderer_id);
2403 return_value->SetInteger("v8_memory_allocated", 2407 return_value->SetInteger("v8_memory_allocated",
2404 v8_heap_details->v8_memory_allocated()); 2408 v8_heap_details->v8_memory_allocated());
2405 return_value->SetInteger("v8_memory_used", 2409 return_value->SetInteger("v8_memory_used",
2406 v8_heap_details->v8_memory_used()); 2410 v8_heap_details->v8_memory_used());
2407 2411
2408 if (automation_.get()) { 2412 if (automation_.get()) {
2409 AutomationJSONReply(automation_.get(), reply_message_.release()) 2413 AutomationJSONReply(automation_.get(), reply_message_.release())
2410 .SendSuccess(return_value.get()); 2414 .SendSuccess(return_value.get());
2411 } 2415 }
(...skipping 29 matching lines...) Expand all
2441 if (renderer_id_ != updated_renderer_id) 2445 if (renderer_id_ != updated_renderer_id)
2442 return; 2446 return;
2443 2447
2444 ChromeRenderMessageFilter::FPSDetails* fps_details = 2448 ChromeRenderMessageFilter::FPSDetails* fps_details =
2445 content::Details<ChromeRenderMessageFilter::FPSDetails>(details).ptr(); 2449 content::Details<ChromeRenderMessageFilter::FPSDetails>(details).ptr();
2446 // Only return information for the routing id of the host render view we're 2450 // Only return information for the routing id of the host render view we're
2447 // interested in. 2451 // interested in.
2448 if (routing_id_ != fps_details->routing_id()) 2452 if (routing_id_ != fps_details->routing_id())
2449 return; 2453 return;
2450 2454
2451 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); 2455 scoped_ptr<base::DictionaryValue> return_value(new base::DictionaryValue);
2452 return_value->SetInteger("renderer_id", updated_renderer_id); 2456 return_value->SetInteger("renderer_id", updated_renderer_id);
2453 return_value->SetInteger("routing_id", fps_details->routing_id()); 2457 return_value->SetInteger("routing_id", fps_details->routing_id());
2454 return_value->SetDouble("fps", fps_details->fps()); 2458 return_value->SetDouble("fps", fps_details->fps());
2455 if (automation_.get()) { 2459 if (automation_.get()) {
2456 AutomationJSONReply(automation_.get(), reply_message_.release()) 2460 AutomationJSONReply(automation_.get(), reply_message_.release())
2457 .SendSuccess(return_value.get()); 2461 .SendSuccess(return_value.get());
2458 } 2462 }
2459 delete this; 2463 delete this;
2460 } 2464 }
2461 2465
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2623 if (automation_.get()) { 2627 if (automation_.get()) {
2624 AutomationJSONReply(automation_.get(), reply_message_.release()) 2628 AutomationJSONReply(automation_.get(), reply_message_.release())
2625 .SendSuccess(NULL); 2629 .SendSuccess(NULL);
2626 } 2630 }
2627 delete this; 2631 delete this;
2628 } 2632 }
2629 } else { 2633 } else {
2630 NOTREACHED(); 2634 NOTREACHED();
2631 } 2635 }
2632 } 2636 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698