OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/ephemeral_app_launcher.h" | 5 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/extensions/extension_install_checker.h" | 9 #include "chrome/browser/extensions/extension_install_checker.h" |
10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 284 } |
285 | 285 |
286 bool EphemeralAppLauncher::LaunchHostedApp(const Extension* extension) const { | 286 bool EphemeralAppLauncher::LaunchHostedApp(const Extension* extension) const { |
287 GURL launch_url = extensions::AppLaunchInfo::GetLaunchWebURL(extension); | 287 GURL launch_url = extensions::AppLaunchInfo::GetLaunchWebURL(extension); |
288 if (!launch_url.is_valid()) | 288 if (!launch_url.is_valid()) |
289 return false; | 289 return false; |
290 | 290 |
291 chrome::ScopedTabbedBrowserDisplayer displayer( | 291 chrome::ScopedTabbedBrowserDisplayer displayer( |
292 profile(), chrome::GetHostDesktopTypeForNativeWindow(parent_window_)); | 292 profile(), chrome::GetHostDesktopTypeForNativeWindow(parent_window_)); |
293 chrome::NavigateParams params( | 293 chrome::NavigateParams params( |
294 displayer.browser(), launch_url, content::PAGE_TRANSITION_AUTO_TOPLEVEL); | 294 displayer.browser(), launch_url, ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
295 params.disposition = NEW_FOREGROUND_TAB; | 295 params.disposition = NEW_FOREGROUND_TAB; |
296 chrome::Navigate(¶ms); | 296 chrome::Navigate(¶ms); |
297 return true; | 297 return true; |
298 } | 298 } |
299 | 299 |
300 void EphemeralAppLauncher::InvokeCallback(webstore_install::Result result, | 300 void EphemeralAppLauncher::InvokeCallback(webstore_install::Result result, |
301 const std::string& error) { | 301 const std::string& error) { |
302 if (!launch_callback_.is_null()) { | 302 if (!launch_callback_.is_null()) { |
303 LaunchCallback callback = launch_callback_; | 303 LaunchCallback callback = launch_callback_; |
304 launch_callback_.Reset(); | 304 launch_callback_.Reset(); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 456 |
457 // CompleteInstall will call Release. | 457 // CompleteInstall will call Release. |
458 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, | 458 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, |
459 std::string()); | 459 std::string()); |
460 } | 460 } |
461 | 461 |
462 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 462 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
463 // CompleteInstall will call Release. | 463 // CompleteInstall will call Release. |
464 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); | 464 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); |
465 } | 465 } |
OLD | NEW |