OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/chrome_app_delegate.h" | 5 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/app_mode/app_mode_utils.h" | 9 #include "chrome/browser/app_mode/app_mode_utils.h" |
10 #include "chrome/browser/apps/scoped_keep_alive.h" | |
11 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 11 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
13 #include "chrome/browser/favicon/favicon_utils.h" | 12 #include "chrome/browser/favicon/favicon_utils.h" |
14 #include "chrome/browser/file_select_helper.h" | 13 #include "chrome/browser/file_select_helper.h" |
| 14 #include "chrome/browser/lifetime/browser_keep_alive.h" |
15 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 15 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
16 #include "chrome/browser/platform_util.h" | 16 #include "chrome/browser/platform_util.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/shell_integration.h" | 18 #include "chrome/browser/shell_integration.h" |
19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
20 #include "chrome/browser/ui/browser_dialogs.h" | 20 #include "chrome/browser/ui/browser_dialogs.h" |
21 #include "chrome/browser/ui/browser_navigator_params.h" | 21 #include "chrome/browser/ui/browser_navigator_params.h" |
22 #include "chrome/browser/ui/browser_tabstrip.h" | 22 #include "chrome/browser/ui/browser_tabstrip.h" |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 24 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
(...skipping 15 matching lines...) Expand all Loading... |
40 | 40 |
41 #if defined(ENABLE_PRINTING) | 41 #if defined(ENABLE_PRINTING) |
42 #if defined(ENABLE_PRINT_PREVIEW) | 42 #if defined(ENABLE_PRINT_PREVIEW) |
43 #include "chrome/browser/printing/print_preview_message_handler.h" | 43 #include "chrome/browser/printing/print_preview_message_handler.h" |
44 #include "chrome/browser/printing/print_view_manager.h" | 44 #include "chrome/browser/printing/print_view_manager.h" |
45 #else | 45 #else |
46 #include "chrome/browser/printing/print_view_manager_basic.h" | 46 #include "chrome/browser/printing/print_view_manager_basic.h" |
47 #endif // defined(ENABLE_PRINT_PREVIEW) | 47 #endif // defined(ENABLE_PRINT_PREVIEW) |
48 #endif // defined(ENABLE_PRINTING) | 48 #endif // defined(ENABLE_PRINTING) |
49 | 49 |
| 50 using browser_lifetime::ScopedKeepAlive; |
| 51 |
50 namespace { | 52 namespace { |
51 | 53 |
52 // Time to wait for an app window to show before allowing Chrome to quit. | 54 // Time to wait for an app window to show before allowing Chrome to quit. |
53 int kAppWindowFirstShowTimeoutSeconds = 10; | 55 int kAppWindowFirstShowTimeoutSeconds = 10; |
54 | 56 |
55 bool disable_external_open_for_testing_ = false; | 57 bool disable_external_open_for_testing_ = false; |
56 | 58 |
57 // Opens a URL with Chromium (not external browser) with the right profile. | 59 // Opens a URL with Chromium (not external browser) with the right profile. |
58 content::WebContents* OpenURLFromTabInternal( | 60 content::WebContents* OpenURLFromTabInternal( |
59 content::BrowserContext* context, | 61 content::BrowserContext* context, |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 const content::NotificationDetails& details) { | 353 const content::NotificationDetails& details) { |
352 switch (type) { | 354 switch (type) { |
353 case chrome::NOTIFICATION_APP_TERMINATING: | 355 case chrome::NOTIFICATION_APP_TERMINATING: |
354 if (!terminating_callback_.is_null()) | 356 if (!terminating_callback_.is_null()) |
355 terminating_callback_.Run(); | 357 terminating_callback_.Run(); |
356 break; | 358 break; |
357 default: | 359 default: |
358 NOTREACHED() << "Received unexpected notification"; | 360 NOTREACHED() << "Received unexpected notification"; |
359 } | 361 } |
360 } | 362 } |
OLD | NEW |