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

Side by Side Diff: chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc

Issue 1055673002: [Extensions API] Remove inline enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 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
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/extensions/api/runtime/chrome_runtime_api_delegate.h" 5 #include "chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 chrome::NavigateParams params( 180 chrome::NavigateParams params(
181 browser, uninstall_url, ui::PAGE_TRANSITION_CLIENT_REDIRECT); 181 browser, uninstall_url, ui::PAGE_TRANSITION_CLIENT_REDIRECT);
182 params.disposition = NEW_FOREGROUND_TAB; 182 params.disposition = NEW_FOREGROUND_TAB;
183 params.user_gesture = false; 183 params.user_gesture = false;
184 chrome::Navigate(&params); 184 chrome::Navigate(&params);
185 } 185 }
186 186
187 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { 187 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) {
188 const char* os = update_client::UpdateQueryParams::GetOS(); 188 const char* os = update_client::UpdateQueryParams::GetOS();
189 if (strcmp(os, "mac") == 0) { 189 if (strcmp(os, "mac") == 0) {
190 info->os = PlatformInfo::OS_MAC_; 190 info->os = extensions::core_api::runtime::PLATFORM_OS_MAC;
191 } else if (strcmp(os, "win") == 0) { 191 } else if (strcmp(os, "win") == 0) {
192 info->os = PlatformInfo::OS_WIN_; 192 info->os = extensions::core_api::runtime::PLATFORM_OS_WIN;
193 } else if (strcmp(os, "cros") == 0) { 193 } else if (strcmp(os, "cros") == 0) {
194 info->os = PlatformInfo::OS_CROS_; 194 info->os = extensions::core_api::runtime::PLATFORM_OS_CROS;
195 } else if (strcmp(os, "linux") == 0) { 195 } else if (strcmp(os, "linux") == 0) {
196 info->os = PlatformInfo::OS_LINUX_; 196 info->os = extensions::core_api::runtime::PLATFORM_OS_LINUX;
197 } else if (strcmp(os, "openbsd") == 0) { 197 } else if (strcmp(os, "openbsd") == 0) {
198 info->os = PlatformInfo::OS_OPENBSD_; 198 info->os = extensions::core_api::runtime::PLATFORM_OS_OPENBSD;
199 } else { 199 } else {
200 NOTREACHED(); 200 NOTREACHED();
201 return false; 201 return false;
202 } 202 }
203 203
204 const char* arch = update_client::UpdateQueryParams::GetArch(); 204 const char* arch = update_client::UpdateQueryParams::GetArch();
205 if (strcmp(arch, "arm") == 0) { 205 if (strcmp(arch, "arm") == 0) {
206 info->arch = PlatformInfo::ARCH_ARM; 206 info->arch = extensions::core_api::runtime::PLATFORM_ARCH_ARM;
207 } else if (strcmp(arch, "x86") == 0) { 207 } else if (strcmp(arch, "x86") == 0) {
208 info->arch = PlatformInfo::ARCH_X86_32; 208 info->arch = extensions::core_api::runtime::PLATFORM_ARCH_X86_32;
209 } else if (strcmp(arch, "x64") == 0) { 209 } else if (strcmp(arch, "x64") == 0) {
210 info->arch = PlatformInfo::ARCH_X86_64; 210 info->arch = extensions::core_api::runtime::PLATFORM_ARCH_X86_64;
211 } else { 211 } else {
212 NOTREACHED(); 212 NOTREACHED();
213 return false; 213 return false;
214 } 214 }
215 215
216 const char* nacl_arch = update_client::UpdateQueryParams::GetNaclArch(); 216 const char* nacl_arch = update_client::UpdateQueryParams::GetNaclArch();
217 if (strcmp(nacl_arch, "arm") == 0) { 217 if (strcmp(nacl_arch, "arm") == 0) {
218 info->nacl_arch = PlatformInfo::NACL_ARCH_ARM; 218 info->nacl_arch =
219 extensions::core_api::runtime::PLATFORM_NACL_ARCH_ARM;
219 } else if (strcmp(nacl_arch, "x86-32") == 0) { 220 } else if (strcmp(nacl_arch, "x86-32") == 0) {
220 info->nacl_arch = PlatformInfo::NACL_ARCH_X86_32; 221 info->nacl_arch =
222 extensions::core_api::runtime::PLATFORM_NACL_ARCH_X86_32;
221 } else if (strcmp(nacl_arch, "x86-64") == 0) { 223 } else if (strcmp(nacl_arch, "x86-64") == 0) {
222 info->nacl_arch = PlatformInfo::NACL_ARCH_X86_64; 224 info->nacl_arch =
225 extensions::core_api::runtime::PLATFORM_NACL_ARCH_X86_64;
223 } else { 226 } else {
224 NOTREACHED(); 227 NOTREACHED();
225 return false; 228 return false;
226 } 229 }
227 230
228 return true; 231 return true;
229 } 232 }
230 233
231 bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) { 234 bool ChromeRuntimeAPIDelegate::RestartDevice(std::string* error_message) {
232 #if defined(OS_CHROMEOS) 235 #if defined(OS_CHROMEOS)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 const UpdateCheckResult& result) { 287 const UpdateCheckResult& result) {
285 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; 288 UpdateCallbackList callbacks = pending_update_checks_[extension_id];
286 pending_update_checks_.erase(extension_id); 289 pending_update_checks_.erase(extension_id);
287 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); 290 for (UpdateCallbackList::const_iterator iter = callbacks.begin();
288 iter != callbacks.end(); 291 iter != callbacks.end();
289 ++iter) { 292 ++iter) {
290 const UpdateCheckCallback& callback = *iter; 293 const UpdateCheckCallback& callback = *iter;
291 callback.Run(result); 294 callback.Run(result);
292 } 295 }
293 } 296 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/omnibox/omnibox_api.cc ('k') | chrome/browser/extensions/api/sessions/sessions_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698