OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser/ui/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 #include "ui/events/keycodes/keyboard_codes.h" | 79 #include "ui/events/keycodes/keyboard_codes.h" |
80 | 80 |
81 #if defined(OS_WIN) | 81 #if defined(OS_WIN) |
82 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 82 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
83 #endif | 83 #endif |
84 | 84 |
85 #if defined(ENABLE_EXTENSIONS) | 85 #if defined(ENABLE_EXTENSIONS) |
86 #include "chrome/browser/extensions/api/commands/command_service.h" | 86 #include "chrome/browser/extensions/api/commands/command_service.h" |
87 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 87 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
88 #include "chrome/browser/extensions/tab_helper.h" | 88 #include "chrome/browser/extensions/tab_helper.h" |
89 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" | |
90 #include "chrome/browser/web_applications/web_app.h" | 89 #include "chrome/browser/web_applications/web_app.h" |
| 90 #include "chrome/common/extensions/extension_metrics.h" |
91 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 91 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
92 #include "extensions/browser/extension_registry.h" | 92 #include "extensions/browser/extension_registry.h" |
93 #include "extensions/browser/extension_system.h" | 93 #include "extensions/browser/extension_system.h" |
94 #include "extensions/common/extension.h" | 94 #include "extensions/common/extension.h" |
95 #include "extensions/common/extension_set.h" | 95 #include "extensions/common/extension_set.h" |
96 #endif | 96 #endif |
97 | 97 |
98 #if defined(ENABLE_PRINTING) | 98 #if defined(ENABLE_PRINTING) |
99 #if defined(ENABLE_PRINT_PREVIEW) | 99 #if defined(ENABLE_PRINT_PREVIEW) |
100 #include "chrome/browser/printing/print_preview_dialog_controller.h" | 100 #include "chrome/browser/printing/print_preview_dialog_controller.h" |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER; | 535 TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER; |
536 Navigate(¶ms); | 536 Navigate(¶ms); |
537 | 537 |
538 #if defined(ENABLE_EXTENSIONS) | 538 #if defined(ENABLE_EXTENSIONS) |
539 DCHECK(extensions::ExtensionSystem::Get( | 539 DCHECK(extensions::ExtensionSystem::Get( |
540 browser->profile())->extension_service()); | 540 browser->profile())->extension_service()); |
541 const extensions::Extension* extension = | 541 const extensions::Extension* extension = |
542 extensions::ExtensionRegistry::Get(browser->profile()) | 542 extensions::ExtensionRegistry::Get(browser->profile()) |
543 ->enabled_extensions().GetAppByURL(url); | 543 ->enabled_extensions().GetAppByURL(url); |
544 if (extension) { | 544 if (extension) { |
545 CoreAppLauncherHandler::RecordAppLaunchType( | 545 extensions::RecordAppLaunchType(extension_misc::APP_LAUNCH_OMNIBOX_LOCATION, |
546 extension_misc::APP_LAUNCH_OMNIBOX_LOCATION, | 546 extension->GetType()); |
547 extension->GetType()); | |
548 } | 547 } |
549 #endif | 548 #endif |
550 } | 549 } |
551 | 550 |
552 void Stop(Browser* browser) { | 551 void Stop(Browser* browser) { |
553 content::RecordAction(UserMetricsAction("Stop")); | 552 content::RecordAction(UserMetricsAction("Stop")); |
554 browser->tab_strip_model()->GetActiveWebContents()->Stop(); | 553 browser->tab_strip_model()->GetActiveWebContents()->Stop(); |
555 } | 554 } |
556 | 555 |
557 void NewWindow(Browser* browser) { | 556 void NewWindow(Browser* browser) { |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 browser->host_desktop_type())); | 1289 browser->host_desktop_type())); |
1291 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1290 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1292 | 1291 |
1293 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1292 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1294 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1293 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1295 app_browser->window()->Show(); | 1294 app_browser->window()->Show(); |
1296 } | 1295 } |
1297 #endif // defined(ENABLE_EXTENSIONS) | 1296 #endif // defined(ENABLE_EXTENSIONS) |
1298 | 1297 |
1299 } // namespace chrome | 1298 } // namespace chrome |
OLD | NEW |