OLD | NEW |
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const bool isTablet = false; | 68 const bool isTablet = false; |
69 return std::string("ios-") + (isTablet ? "tablet" : "phone"); | 69 return std::string("ios-") + (isTablet ? "tablet" : "phone"); |
70 #elif defined(OS_MACOSX) | 70 #elif defined(OS_MACOSX) |
71 return "mac"; | 71 return "mac"; |
72 #elif defined(OS_CHROMEOS) | 72 #elif defined(OS_CHROMEOS) |
73 return "chromeos"; | 73 return "chromeos"; |
74 #elif defined(OS_LINUX) | 74 #elif defined(OS_LINUX) |
75 return "linux"; | 75 return "linux"; |
76 #elif defined(OS_ANDROID) | 76 #elif defined(OS_ANDROID) |
77 const bool isTablet = | 77 const bool isTablet = |
78 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUi); | 78 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI); |
79 return std::string("android-") + (isTablet ? "tablet" : "phone"); | 79 return std::string("android-") + (isTablet ? "tablet" : "phone"); |
80 #else | 80 #else |
81 return "none"; | 81 return "none"; |
82 #endif | 82 #endif |
83 } | 83 } |
84 | 84 |
85 // Returns a string suitable for the Promo Server URL 'dist' value. | 85 // Returns a string suitable for the Promo Server URL 'dist' value. |
86 const char* ChannelString() { | 86 const char* ChannelString() { |
87 #if defined (OS_WIN) | 87 #if defined (OS_WIN) |
88 // GetChannel hits the registry on Windows. See http://crbug.com/70898. | 88 // GetChannel hits the registry on Windows. See http://crbug.com/70898. |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 if (group_ < initial_segment_) | 504 if (group_ < initial_segment_) |
505 return start_; | 505 return start_; |
506 return start_ + | 506 return start_ + |
507 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_) | 507 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_) |
508 * time_slice_; | 508 * time_slice_; |
509 } | 509 } |
510 | 510 |
511 double NotificationPromo::EndTime() const { | 511 double NotificationPromo::EndTime() const { |
512 return end_; | 512 return end_; |
513 } | 513 } |
OLD | NEW |