| 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_throttle.h" | 5 #include "chrome/browser/apps/ephemeral_app_throttle.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/apps/ephemeral_app_launcher.h" | 8 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_system.h" | |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_io_data.h" | 11 #include "chrome/browser/profiles/profile_io_data.h" |
| 13 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/extensions/extension_constants.h" | 13 #include "chrome/common/extensions/extension_constants.h" |
| 15 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" | 14 #include "components/navigation_interception/intercept_navigation_resource_throt
tle.h" |
| 16 #include "components/navigation_interception/navigation_params.h" | 15 #include "components/navigation_interception/navigation_params.h" |
| 17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/resource_throttle.h" | 17 #include "content/public/browser/resource_throttle.h" |
| 19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 19 #include "extensions/browser/extension_system.h" |
| 20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
| 21 | 21 |
| 22 using content::BrowserThread; | 22 using content::BrowserThread; |
| 23 using content::WebContents; | 23 using content::WebContents; |
| 24 using extensions::Extension; | 24 using extensions::Extension; |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 bool LaunchEphemeralApp( | 28 bool LaunchEphemeralApp( |
| 29 const std::string& app_id, | 29 const std::string& app_id, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return NULL; | 90 return NULL; |
| 91 | 91 |
| 92 std::string app_id(request->url().ExtractFileName()); | 92 std::string app_id(request->url().ExtractFileName()); |
| 93 if (!Extension::IdIsValid(app_id)) | 93 if (!Extension::IdIsValid(app_id)) |
| 94 return NULL; | 94 return NULL; |
| 95 | 95 |
| 96 return new navigation_interception::InterceptNavigationResourceThrottle( | 96 return new navigation_interception::InterceptNavigationResourceThrottle( |
| 97 request, | 97 request, |
| 98 base::Bind(&LaunchEphemeralApp, app_id)); | 98 base::Bind(&LaunchEphemeralApp, app_id)); |
| 99 } | 99 } |
| OLD | NEW |