| OLD | NEW |
| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 } | 255 } |
| 256 | 256 |
| 257 void ChromeRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { | 257 void ChromeRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { |
| 258 Profile* profile = Profile::FromBrowserContext(browser_context_); | 258 Profile* profile = Profile::FromBrowserContext(browser_context_); |
| 259 Browser* browser = chrome::FindLastActiveWithProfile(profile); | 259 Browser* browser = chrome::FindLastActiveWithProfile(profile); |
| 260 if (!browser) | 260 if (!browser) |
| 261 browser = new Browser(Browser::CreateParams(profile)); | 261 browser = new Browser(Browser::CreateParams(profile)); |
| 262 | 262 |
| 263 chrome::NavigateParams params( | 263 chrome::NavigateParams params( |
| 264 browser, uninstall_url, ui::PAGE_TRANSITION_CLIENT_REDIRECT); | 264 browser, uninstall_url, ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
| 265 params.disposition = NEW_FOREGROUND_TAB; | 265 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
| 266 params.user_gesture = false; | 266 params.user_gesture = false; |
| 267 chrome::Navigate(¶ms); | 267 chrome::Navigate(¶ms); |
| 268 } | 268 } |
| 269 | 269 |
| 270 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { | 270 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { |
| 271 const char* os = update_client::UpdateQueryParams::GetOS(); | 271 const char* os = update_client::UpdateQueryParams::GetOS(); |
| 272 if (strcmp(os, "mac") == 0) { | 272 if (strcmp(os, "mac") == 0) { |
| 273 info->os = extensions::api::runtime::PLATFORM_OS_MAC; | 273 info->os = extensions::api::runtime::PLATFORM_OS_MAC; |
| 274 } else if (strcmp(os, "win") == 0) { | 274 } else if (strcmp(os, "win") == 0) { |
| 275 info->os = extensions::api::runtime::PLATFORM_OS_WIN; | 275 info->os = extensions::api::runtime::PLATFORM_OS_WIN; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 const UpdateCheckResult& result) { | 387 const UpdateCheckResult& result) { |
| 388 auto it = update_check_info_.find(extension_id); | 388 auto it = update_check_info_.find(extension_id); |
| 389 if (it == update_check_info_.end()) | 389 if (it == update_check_info_.end()) |
| 390 return; | 390 return; |
| 391 std::vector<UpdateCheckCallback> callbacks; | 391 std::vector<UpdateCheckCallback> callbacks; |
| 392 it->second.callbacks.swap(callbacks); | 392 it->second.callbacks.swap(callbacks); |
| 393 for (const auto& callback : callbacks) { | 393 for (const auto& callback : callbacks) { |
| 394 callback.Run(result); | 394 callback.Run(result); |
| 395 } | 395 } |
| 396 } | 396 } |
| OLD | NEW |