OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
16 #include "base/values.h" | 16 #include "base/values.h" |
17 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/chrome_version_info.h" | 19 #include "chrome/common/chrome_version_info.h" |
20 #include "chrome/common/crash_keys.h" | 20 #include "chrome/common/crash_keys.h" |
21 #include "chrome/common/extensions/extension_constants.h" | 21 #include "chrome/common/extensions/extension_metrics.h" |
22 #include "chrome/common/localized_error.h" | 22 #include "chrome/common/localized_error.h" |
23 #include "chrome/common/pepper_permission_util.h" | 23 #include "chrome/common/pepper_permission_util.h" |
24 #include "chrome/common/render_messages.h" | 24 #include "chrome/common/render_messages.h" |
25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
26 #include "chrome/grit/generated_resources.h" | 26 #include "chrome/grit/generated_resources.h" |
27 #include "chrome/grit/locale_settings.h" | 27 #include "chrome/grit/locale_settings.h" |
28 #include "chrome/grit/renderer_resources.h" | 28 #include "chrome/grit/renderer_resources.h" |
29 #include "chrome/renderer/benchmarking_extension.h" | 29 #include "chrome/renderer/benchmarking_extension.h" |
30 #include "chrome/renderer/chrome_render_frame_observer.h" | 30 #include "chrome/renderer/chrome_render_frame_observer.h" |
31 #include "chrome/renderer/chrome_render_process_observer.h" | 31 #include "chrome/renderer/chrome_render_process_observer.h" |
(...skipping 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 CrossesExtensionExtents(frame, url, *extensions, is_extension_url, | 1265 CrossesExtensionExtents(frame, url, *extensions, is_extension_url, |
1266 is_initial_navigation)) { | 1266 is_initial_navigation)) { |
1267 // Include the referrer in this case since we're going from a hosted web | 1267 // Include the referrer in this case since we're going from a hosted web |
1268 // page. (the packaged case is handled previously by the extension | 1268 // page. (the packaged case is handled previously by the extension |
1269 // navigation test) | 1269 // navigation test) |
1270 *send_referrer = true; | 1270 *send_referrer = true; |
1271 | 1271 |
1272 const Extension* extension = | 1272 const Extension* extension = |
1273 extension_dispatcher_->extensions()->GetExtensionOrAppByURL(url); | 1273 extension_dispatcher_->extensions()->GetExtensionOrAppByURL(url); |
1274 if (extension && extension->is_app()) { | 1274 if (extension && extension->is_app()) { |
1275 UMA_HISTOGRAM_ENUMERATION( | 1275 extensions::RecordAppLaunchType( |
1276 extension->is_platform_app() ? | 1276 extension_misc::APP_LAUNCH_CONTENT_NAVIGATION, extension->GetType()); |
1277 extension_misc::kPlatformAppLaunchHistogram : | |
1278 extension_misc::kAppLaunchHistogram, | |
1279 extension_misc::APP_LAUNCH_CONTENT_NAVIGATION, | |
1280 extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | |
1281 } | 1277 } |
1282 return true; | 1278 return true; |
1283 } | 1279 } |
1284 | 1280 |
1285 // If this is a reload, check whether it has the wrong process type. We | 1281 // If this is a reload, check whether it has the wrong process type. We |
1286 // should send it to the browser if it's an extension URL (e.g., hosted app) | 1282 // should send it to the browser if it's an extension URL (e.g., hosted app) |
1287 // in a normal process, or if it's a process for an extension that has been | 1283 // in a normal process, or if it's a process for an extension that has been |
1288 // uninstalled. | 1284 // uninstalled. |
1289 if (frame->top()->document().url() == url) { | 1285 if (frame->top()->document().url() == url) { |
1290 if (is_extension_url != extension_dispatcher_->is_extension_process()) | 1286 if (is_extension_url != extension_dispatcher_->is_extension_process()) |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1602 if (mime_type == content::kBrowserPluginMimeType) { | 1598 if (mime_type == content::kBrowserPluginMimeType) { |
1603 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1599 return new extensions::ExtensionsGuestViewContainer(render_frame); |
1604 } else { | 1600 } else { |
1605 return new extensions::MimeHandlerViewContainer( | 1601 return new extensions::MimeHandlerViewContainer( |
1606 render_frame, mime_type, original_url); | 1602 render_frame, mime_type, original_url); |
1607 } | 1603 } |
1608 #else | 1604 #else |
1609 return NULL; | 1605 return NULL; |
1610 #endif | 1606 #endif |
1611 } | 1607 } |
OLD | NEW |