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" |
11 #include "chrome/browser/extensions/extension_util.h" | 11 #include "chrome/browser/extensions/extension_util.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/browser_navigator.h" | 13 #include "chrome/browser/ui/browser_navigator.h" |
| 14 #include "chrome/browser/ui/browser_navigator_params.h" |
14 #include "chrome/browser/ui/extensions/app_launch_params.h" | 15 #include "chrome/browser/ui/extensions/app_launch_params.h" |
15 #include "chrome/browser/ui/extensions/application_launch.h" | 16 #include "chrome/browser/ui/extensions/application_launch.h" |
16 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 17 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
17 #include "chrome/browser/ui/native_window_tracker.h" | 18 #include "chrome/browser/ui/native_window_tracker.h" |
18 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 19 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
19 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 21 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
22 #include "extensions/browser/extension_prefs.h" | 23 #include "extensions/browser/extension_prefs.h" |
23 #include "extensions/browser/extension_registry.h" | 24 #include "extensions/browser/extension_registry.h" |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 161 |
161 EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id, | 162 EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id, |
162 Profile* profile, | 163 Profile* profile, |
163 gfx::NativeWindow parent_window, | 164 gfx::NativeWindow parent_window, |
164 const LaunchCallback& callback) | 165 const LaunchCallback& callback) |
165 : WebstoreStandaloneInstaller(webstore_item_id, profile, Callback()), | 166 : WebstoreStandaloneInstaller(webstore_item_id, profile, Callback()), |
166 launch_callback_(callback), | 167 launch_callback_(callback), |
167 parent_window_(parent_window), | 168 parent_window_(parent_window), |
168 dummy_web_contents_( | 169 dummy_web_contents_( |
169 WebContents::Create(WebContents::CreateParams(profile))) { | 170 WebContents::Create(WebContents::CreateParams(profile))) { |
170 if (parent_window_) | 171 if (parent_window_) |
171 parent_window_tracker_ = NativeWindowTracker::Create(parent_window); | 172 parent_window_tracker_ = NativeWindowTracker::Create(parent_window); |
172 } | 173 } |
173 | 174 |
174 EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id, | 175 EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id, |
175 content::WebContents* web_contents, | 176 content::WebContents* web_contents, |
176 const LaunchCallback& callback) | 177 const LaunchCallback& callback) |
177 : WebstoreStandaloneInstaller(webstore_item_id, | 178 : WebstoreStandaloneInstaller(webstore_item_id, |
178 ProfileForWebContents(web_contents), | 179 ProfileForWebContents(web_contents), |
179 Callback()), | 180 Callback()), |
180 content::WebContentsObserver(web_contents), | 181 content::WebContentsObserver(web_contents), |
181 launch_callback_(callback), | 182 launch_callback_(callback), |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 468 |
468 // CompleteInstall will call Release. | 469 // CompleteInstall will call Release. |
469 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, | 470 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, |
470 std::string()); | 471 std::string()); |
471 } | 472 } |
472 | 473 |
473 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 474 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
474 // CompleteInstall will call Release. | 475 // CompleteInstall will call Release. |
475 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); | 476 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); |
476 } | 477 } |
OLD | NEW |