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

Side by Side Diff: chrome/browser/ui/webui/copresence_ui_handler.cc

Issue 1550053002: Convert Pass()→std::move() in //chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/ui/webui/copresence_ui_handler.h" 5 #include "chrome/browser/ui/webui/copresence_ui_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 scoped_ptr<DictionaryValue> FormatToken(const T& token) { 91 scoped_ptr<DictionaryValue> FormatToken(const T& token) {
92 scoped_ptr<DictionaryValue> js_token(new DictionaryValue); 92 scoped_ptr<DictionaryValue> js_token(new DictionaryValue);
93 93
94 js_token->SetString("id", token.id); 94 js_token->SetString("id", token.id);
95 js_token->SetString("statuses", ConvertStatus(token)); 95 js_token->SetString("statuses", ConvertStatus(token));
96 js_token->SetString("medium", FormatMedium(token.medium)); 96 js_token->SetString("medium", FormatMedium(token.medium));
97 DCHECK(!token.start_time.is_null()); 97 DCHECK(!token.start_time.is_null());
98 js_token->SetString("time", 98 js_token->SetString("time",
99 base::TimeFormatTimeOfDay(token.start_time)); 99 base::TimeFormatTimeOfDay(token.start_time));
100 100
101 return js_token.Pass(); 101 return js_token;
102 } 102 }
103 103
104 // Retrieve the CopresenceService, if any. 104 // Retrieve the CopresenceService, if any.
105 CopresenceService* GetCopresenceService(WebUI* web_ui) { 105 CopresenceService* GetCopresenceService(WebUI* web_ui) {
106 DCHECK(web_ui); 106 DCHECK(web_ui);
107 return CopresenceService::GetFactoryInstance()->Get( 107 return CopresenceService::GetFactoryInstance()->Get(
108 web_ui->GetWebContents()->GetBrowserContext()); 108 web_ui->GetWebContents()->GetBrowserContext());
109 } 109 }
110 110
111 // Safely retrieve the CopresenceState, if any. 111 // Safely retrieve the CopresenceState, if any.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 // CopresenceService::ResetState() deletes the CopresenceState object 204 // CopresenceService::ResetState() deletes the CopresenceState object
205 // we were using. We have to get the new one and reconnect to it. 205 // we were using. We have to get the new one and reconnect to it.
206 state_ = GetCopresenceState(service); 206 state_ = GetCopresenceState(service);
207 DCHECK(state_); 207 DCHECK(state_);
208 state_->AddObserver(this); 208 state_->AddObserver(this);
209 209
210 web_ui()->CallJavascriptFunction("clearTokens"); 210 web_ui()->CallJavascriptFunction("clearTokens");
211 DirectivesUpdated(); 211 DirectivesUpdated();
212 } 212 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/copresence_ui.cc ('k') | chrome/browser/ui/webui/engagement/site_engagement_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698