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 "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 void ChromeRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { | 168 void ChromeRuntimeAPIDelegate::OpenURL(const GURL& uninstall_url) { |
169 Profile* profile = Profile::FromBrowserContext(browser_context_); | 169 Profile* profile = Profile::FromBrowserContext(browser_context_); |
170 Browser* browser = | 170 Browser* browser = |
171 chrome::FindLastActiveWithProfile(profile, chrome::GetActiveDesktop()); | 171 chrome::FindLastActiveWithProfile(profile, chrome::GetActiveDesktop()); |
172 if (!browser) | 172 if (!browser) |
173 browser = | 173 browser = |
174 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); | 174 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); |
175 | 175 |
176 chrome::NavigateParams params( | 176 chrome::NavigateParams params( |
177 browser, uninstall_url, content::PAGE_TRANSITION_CLIENT_REDIRECT); | 177 browser, uninstall_url, ui::PAGE_TRANSITION_CLIENT_REDIRECT); |
178 params.disposition = NEW_FOREGROUND_TAB; | 178 params.disposition = NEW_FOREGROUND_TAB; |
179 params.user_gesture = false; | 179 params.user_gesture = false; |
180 chrome::Navigate(¶ms); | 180 chrome::Navigate(¶ms); |
181 } | 181 } |
182 | 182 |
183 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { | 183 bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { |
184 const char* os = omaha_query_params::OmahaQueryParams::GetOS(); | 184 const char* os = omaha_query_params::OmahaQueryParams::GetOS(); |
185 if (strcmp(os, "mac") == 0) { | 185 if (strcmp(os, "mac") == 0) { |
186 info->os = PlatformInfo::OS_MAC_; | 186 info->os = PlatformInfo::OS_MAC_; |
187 } else if (strcmp(os, "win") == 0) { | 187 } else if (strcmp(os, "win") == 0) { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 const UpdateCheckResult& result) { | 271 const UpdateCheckResult& result) { |
272 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; | 272 UpdateCallbackList callbacks = pending_update_checks_[extension_id]; |
273 pending_update_checks_.erase(extension_id); | 273 pending_update_checks_.erase(extension_id); |
274 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); | 274 for (UpdateCallbackList::const_iterator iter = callbacks.begin(); |
275 iter != callbacks.end(); | 275 iter != callbacks.end(); |
276 ++iter) { | 276 ++iter) { |
277 const UpdateCheckCallback& callback = *iter; | 277 const UpdateCheckCallback& callback = *iter; |
278 callback.Run(result); | 278 callback.Run(result); |
279 } | 279 } |
280 } | 280 } |
OLD | NEW |