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

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

Issue 10808052: Tidy up Android's is-tablet functionality. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: TabletUi -> TabletUI 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 | 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/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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const bool isTablet = false; 52 const bool isTablet = false;
53 return std::string("ios-") + (isTablet ? "tablet" : "phone"); 53 return std::string("ios-") + (isTablet ? "tablet" : "phone");
54 #elif defined(OS_MACOSX) 54 #elif defined(OS_MACOSX)
55 return "mac"; 55 return "mac";
56 #elif defined(OS_CHROMEOS) 56 #elif defined(OS_CHROMEOS)
57 return "chromeos"; 57 return "chromeos";
58 #elif defined(OS_LINUX) 58 #elif defined(OS_LINUX)
59 return "linux"; 59 return "linux";
60 #elif defined(OS_ANDROID) 60 #elif defined(OS_ANDROID)
61 const bool isTablet = 61 const bool isTablet =
62 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUi); 62 CommandLine::ForCurrentProcess()->HasSwitch(switches::kTabletUI);
63 return std::string("android-") + (isTablet ? "tablet" : "phone"); 63 return std::string("android-") + (isTablet ? "tablet" : "phone");
64 #else 64 #else
65 return "none"; 65 return "none";
66 #endif 66 #endif
67 } 67 }
68 68
69 // Returns a string suitable for the Promo Server URL 'dist' value. 69 // Returns a string suitable for the Promo Server URL 'dist' value.
70 const char* ChannelString() { 70 const char* ChannelString() {
71 #if defined (OS_WIN) 71 #if defined (OS_WIN)
72 // GetChannel hits the registry on Windows. See http://crbug.com/70898. 72 // GetChannel hits the registry on Windows. See http://crbug.com/70898.
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 if (group_ < initial_segment_) 442 if (group_ < initial_segment_)
443 return start_; 443 return start_;
444 return start_ + 444 return start_ +
445 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_) 445 std::ceil(static_cast<float>(group_ - initial_segment_ + 1) / increment_)
446 * time_slice_; 446 * time_slice_;
447 } 447 }
448 448
449 double NotificationPromo::EndTime() const { 449 double NotificationPromo::EndTime() const {
450 return end_; 450 return end_;
451 } 451 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698