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

Side by Side Diff: chrome/browser/signin/easy_unlock_screenlock_state_handler_unittest.cc

Issue 1609923002: Fix remaining incompatibilities between scoped_ptr and unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/signin/easy_unlock_screenlock_state_handler.h" 5 #include "chrome/browser/signin/easy_unlock_screenlock_state_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 // Returns the number of times an icon was shown since the last call to this 133 // Returns the number of times an icon was shown since the last call to this
134 // method. 134 // method.
135 size_t GetAndResetShowIconCount() { 135 size_t GetAndResetShowIconCount() {
136 size_t result = show_icon_count_; 136 size_t result = show_icon_count_;
137 show_icon_count_ = 0u; 137 show_icon_count_ = 0u;
138 return result; 138 return result;
139 } 139 }
140 140
141 // Whether the custom icon is set. 141 // Whether the custom icon is set.
142 bool HasCustomIcon() const { 142 bool HasCustomIcon() const { return !!last_custom_icon_; }
143 return last_custom_icon_;
144 }
145 143
146 // If custom icon is set, returns the icon's id. 144 // If custom icon is set, returns the icon's id.
147 // If there is no icon, or if it doesn't have an id set, returns an empty 145 // If there is no icon, or if it doesn't have an id set, returns an empty
148 // string. 146 // string.
149 std::string GetCustomIconId() const { 147 std::string GetCustomIconId() const {
150 std::string result; 148 std::string result;
151 if (last_custom_icon_) 149 if (last_custom_icon_)
152 last_custom_icon_->GetString("id", &result); 150 last_custom_icon_->GetString("id", &result);
153 return result; 151 return result;
154 } 152 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 state_handler_->RecordClickOnLockIcon(); 740 state_handler_->RecordClickOnLockIcon();
743 histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4); 741 histogram_tester.ExpectTotalCount("EasyUnlock.TrialRun.Events", 4);
744 histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events", 742 histogram_tester.ExpectBucketCount("EasyUnlock.TrialRun.Events",
745 EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1); 743 EASY_UNLOCK_TRIAL_RUN_EVENT_LAUNCHED, 1);
746 histogram_tester.ExpectBucketCount( 744 histogram_tester.ExpectBucketCount(
747 "EasyUnlock.TrialRun.Events", 745 "EasyUnlock.TrialRun.Events",
748 EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3); 746 EASY_UNLOCK_TRIAL_RUN_EVENT_CLICKED_LOCK_ICON, 3);
749 } 747 }
750 748
751 } // namespace 749 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698