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

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

Issue 2824363002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/ui (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chrome/browser/ui/webui/theme_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/version_handler.h" 5 #include "chrome/browser/ui/webui/version_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 base::Bind(&VersionHandler::OnGotPlugins, 73 base::Bind(&VersionHandler::OnGotPlugins,
74 weak_ptr_factory_.GetWeakPtr())); 74 weak_ptr_factory_.GetWeakPtr()));
75 #endif 75 #endif
76 76
77 // Grab the executable path on the FILE thread. It is returned in 77 // Grab the executable path on the FILE thread. It is returned in
78 // OnGotFilePaths. 78 // OnGotFilePaths.
79 base::string16* exec_path_buffer = new base::string16; 79 base::string16* exec_path_buffer = new base::string16;
80 base::string16* profile_path_buffer = new base::string16; 80 base::string16* profile_path_buffer = new base::string16;
81 content::BrowserThread::PostTaskAndReply( 81 content::BrowserThread::PostTaskAndReply(
82 content::BrowserThread::FILE, FROM_HERE, 82 content::BrowserThread::FILE, FROM_HERE,
83 base::Bind(&GetFilePaths, Profile::FromWebUI(web_ui())->GetPath(), 83 base::BindOnce(&GetFilePaths, Profile::FromWebUI(web_ui())->GetPath(),
84 base::Unretained(exec_path_buffer), 84 base::Unretained(exec_path_buffer),
85 base::Unretained(profile_path_buffer)), 85 base::Unretained(profile_path_buffer)),
86 base::Bind(&VersionHandler::OnGotFilePaths, 86 base::BindOnce(
87 weak_ptr_factory_.GetWeakPtr(), 87 &VersionHandler::OnGotFilePaths, weak_ptr_factory_.GetWeakPtr(),
88 base::Owned(exec_path_buffer), 88 base::Owned(exec_path_buffer), base::Owned(profile_path_buffer)));
89 base::Owned(profile_path_buffer)));
90 89
91 // Respond with the variations info immediately. 90 // Respond with the variations info immediately.
92 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnVariationInfo, 91 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnVariationInfo,
93 *version_ui::GetVariationsList()); 92 *version_ui::GetVariationsList());
94 } 93 }
95 94
96 void VersionHandler::OnGotFilePaths(base::string16* executable_path_data, 95 void VersionHandler::OnGotFilePaths(base::string16* executable_path_data,
97 base::string16* profile_path_data) { 96 base::string16* profile_path_data) {
98 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 97 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
99 98
(...skipping 23 matching lines...) Expand all
123 break; 122 break;
124 } 123 }
125 } 124 }
126 } 125 }
127 126
128 base::Value arg(flash_version_and_path); 127 base::Value arg(flash_version_and_path);
129 128
130 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFlashVersion, arg); 129 web_ui()->CallJavascriptFunctionUnsafe(version_ui::kReturnFlashVersion, arg);
131 } 130 }
132 #endif // BUILDFLAG(ENABLE_PLUGINS) 131 #endif // BUILDFLAG(ENABLE_PLUGINS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/theme_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698