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

Side by Side Diff: chrome/browser/web_resource/notification_promo.cc

Issue 11823007: Fix some pecularities in my C++ style for achuith@. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: achuith@ review Created 7 years, 11 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 | « no previous file | chrome/browser/web_resource/promo_resource_service.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) 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/web_resource/notification_promo.h" 5 #include "chrome/browser/web_resource/notification_promo.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 // static 314 // static
315 void NotificationPromo::RegisterPrefs(PrefServiceSimple* local_state) { 315 void NotificationPromo::RegisterPrefs(PrefServiceSimple* local_state) {
316 local_state->RegisterDictionaryPref(kPrefPromoObject); 316 local_state->RegisterDictionaryPref(kPrefPromoObject);
317 } 317 }
318 318
319 // static 319 // static
320 void NotificationPromo::RegisterUserPrefs(PrefServiceSyncable* prefs) { 320 void NotificationPromo::RegisterUserPrefs(PrefServiceSyncable* prefs) {
321 // TODO(dbeam): Remove in M28 when we're reasonably sure all prefs are gone. 321 // TODO(dbeam): Remove in M28 when we're reasonably sure all prefs are gone.
322 // http://crbug.com/168887
322 prefs->RegisterDictionaryPref(kPrefPromoObject, 323 prefs->RegisterDictionaryPref(kPrefPromoObject,
323 PrefServiceSyncable::UNSYNCABLE_PREF); 324 PrefServiceSyncable::UNSYNCABLE_PREF);
324 prefs->ClearPref(kPrefPromoObject); 325 prefs->ClearPref(kPrefPromoObject);
325 } 326 }
326 327
327 void NotificationPromo::WritePrefs() { 328 void NotificationPromo::WritePrefs() {
328 base::DictionaryValue* ntp_promo = new base::DictionaryValue; 329 base::DictionaryValue* ntp_promo = new base::DictionaryValue;
329 ntp_promo->SetString(kPrefPromoText, promo_text_); 330 ntp_promo->SetString(kPrefPromoText, promo_text_);
330 ntp_promo->Set(kPrefPromoPayload, promo_payload_->DeepCopy()); 331 ntp_promo->Set(kPrefPromoPayload, promo_payload_->DeepCopy());
331 ntp_promo->SetDouble(kPrefPromoStart, start_); 332 ntp_promo->SetDouble(kPrefPromoStart, start_);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 if (group_ < initial_segment_) 446 if (group_ < initial_segment_)
446 return start_; 447 return start_;
447 return start_ + 448 return start_ +
448 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_) 449 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_)
449 * time_slice_; 450 * time_slice_;
450 } 451 }
451 452
452 double NotificationPromo::EndTime() const { 453 double NotificationPromo::EndTime() const {
453 return end_; 454 return end_;
454 } 455 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/web_resource/promo_resource_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698