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

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

Issue 10690096: Extracted inner class doing process dispatch. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Adding comment. Created 8 years, 5 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
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 19 matching lines...) Expand all
30 const char promo_server_url[] = "https://clients3.google.com/crsignal/client"; 30 const char promo_server_url[] = "https://clients3.google.com/crsignal/client";
31 31
32 double GetTimeFromPrefs(PrefService* prefs, const char* pref) { 32 double GetTimeFromPrefs(PrefService* prefs, const char* pref) {
33 return prefs->HasPrefPath(pref) ? prefs->GetDouble(pref) : 0.0; 33 return prefs->HasPrefPath(pref) ? prefs->GetDouble(pref) : 0.0;
34 } 34 }
35 35
36 // Returns a string suitable for the Promo Server URL 'osname' value. 36 // Returns a string suitable for the Promo Server URL 'osname' value.
37 const char* PlatformString() { 37 const char* PlatformString() {
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 return "win"; 39 return "win";
40 #elif defined(OS_IOS)
41 return "ios";
40 #elif defined(OS_MACOSX) 42 #elif defined(OS_MACOSX)
41 return "mac"; 43 return "mac";
42 #elif defined(OS_CHROMEOS) 44 #elif defined(OS_CHROMEOS)
43 return "chromeos"; 45 return "chromeos";
44 #elif defined(OS_LINUX) 46 #elif defined(OS_LINUX)
45 return "linux"; 47 return "linux";
46 #else 48 #else
47 return "none"; 49 return "none";
48 #endif 50 #endif
49 } 51 }
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (group_ < initial_segment_) 335 if (group_ < initial_segment_)
334 return start_; 336 return start_;
335 return start_ + 337 return start_ +
336 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_) 338 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_)
337 * time_slice_; 339 * time_slice_;
338 } 340 }
339 341
340 double NotificationPromo::EndTime() const { 342 double NotificationPromo::EndTime() const {
341 return end_; 343 return end_;
342 } 344 }
OLDNEW
« no previous file with comments | « chrome/browser/web_resource/json_asynchronous_unpacker.cc ('k') | chrome/browser/web_resource/promo_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698