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

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

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 years, 4 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
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 DictionaryValue* InitialLoadObserver::GetTimingInformation() const { 134 DictionaryValue* InitialLoadObserver::GetTimingInformation() const {
135 ListValue* items = new ListValue; 135 ListValue* items = new ListValue;
136 for (TabTimeMap::const_iterator it = loading_tabs_.begin(); 136 for (TabTimeMap::const_iterator it = loading_tabs_.begin();
137 it != loading_tabs_.end(); 137 it != loading_tabs_.end();
138 ++it) { 138 ++it) {
139 DictionaryValue* item = new DictionaryValue; 139 DictionaryValue* item = new DictionaryValue;
140 base::TimeDelta delta_start = it->second.start_time() - init_time_; 140 base::TimeDelta delta_start = it->second.start_time() - init_time_;
141 141
142 item->SetDouble("load_start_ms", delta_start.InMillisecondsF()); 142 item->SetDouble("load_start_ms", delta_start.InMillisecondsF());
143 if (it->second.stop_time().is_null()) { 143 if (it->second.stop_time().is_null()) {
144 item->Set("load_stop_ms", Value::CreateNullValue()); 144 item->Set("load_stop_ms", base::NullValue());
145 } else { 145 } else {
146 base::TimeDelta delta_stop = it->second.stop_time() - init_time_; 146 base::TimeDelta delta_stop = it->second.stop_time() - init_time_;
147 item->SetDouble("load_stop_ms", delta_stop.InMillisecondsF()); 147 item->SetDouble("load_stop_ms", delta_stop.InMillisecondsF());
148 } 148 }
149 items->Append(item); 149 items->Append(item);
150 } 150 }
151 DictionaryValue* return_value = new DictionaryValue; 151 DictionaryValue* return_value = new DictionaryValue;
152 return_value->Set("tabs", items); 152 return_value->Set("tabs", items);
153 return return_value; 153 return return_value;
154 } 154 }
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 void DragTargetDropAckNotificationObserver::Observe( 2614 void DragTargetDropAckNotificationObserver::Observe(
2615 int type, 2615 int type,
2616 const NotificationSource& source, 2616 const NotificationSource& source,
2617 const NotificationDetails& details) { 2617 const NotificationDetails& details) {
2618 if (automation_) { 2618 if (automation_) {
2619 AutomationJSONReply(automation_, 2619 AutomationJSONReply(automation_,
2620 reply_message_.release()).SendSuccess(NULL); 2620 reply_message_.release()).SendSuccess(NULL);
2621 } 2621 }
2622 delete this; 2622 delete this;
2623 } 2623 }
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/custom_handlers/protocol_handler_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698