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/browser/background/background_contents_service.h" | 5 #include "chrome/browser/background/background_contents_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/background/background_contents_service_factory.h" | 14 #include "chrome/browser/background/background_contents_service_factory.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/extensions/extension_host.h" | 16 #include "chrome/browser/extensions/extension_host.h" |
17 #include "chrome/browser/extensions/extension_service.h" | 17 #include "chrome/browser/extensions/extension_service.h" |
18 #include "chrome/browser/notifications/desktop_notification_service.h" | 18 #include "chrome/browser/notifications/desktop_notification_service.h" |
19 #include "chrome/browser/notifications/notification.h" | 19 #include "chrome/browser/notifications/notification.h" |
20 #include "chrome/browser/notifications/notification_ui_manager.h" | 20 #include "chrome/browser/notifications/notification_ui_manager.h" |
21 #include "chrome/browser/prefs/pref_service.h" | 21 #include "chrome/browser/prefs/pref_service.h" |
22 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 22 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
24 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
25 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
| 26 #include "chrome/browser/ui/browser_tabstrip.h" |
26 #include "chrome/common/chrome_notification_types.h" | 27 #include "chrome/common/chrome_notification_types.h" |
27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/common/extensions/extension.h" | 29 #include "chrome/common/extensions/extension.h" |
29 #include "chrome/common/extensions/extension_icon_set.h" | 30 #include "chrome/common/extensions/extension_icon_set.h" |
30 #include "chrome/common/extensions/extension_constants.h" | 31 #include "chrome/common/extensions/extension_constants.h" |
31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
32 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
33 #include "content/public/browser/site_instance.h" | 34 #include "content/public/browser/site_instance.h" |
34 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
35 #include "grit/generated_resources.h" | 36 #include "grit/generated_resources.h" |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 return EmptyString16(); | 607 return EmptyString16(); |
607 } | 608 } |
608 | 609 |
609 void BackgroundContentsService::AddWebContents( | 610 void BackgroundContentsService::AddWebContents( |
610 WebContents* new_contents, | 611 WebContents* new_contents, |
611 WindowOpenDisposition disposition, | 612 WindowOpenDisposition disposition, |
612 const gfx::Rect& initial_pos, | 613 const gfx::Rect& initial_pos, |
613 bool user_gesture) { | 614 bool user_gesture) { |
614 Browser* browser = browser::FindLastActiveWithProfile( | 615 Browser* browser = browser::FindLastActiveWithProfile( |
615 Profile::FromBrowserContext(new_contents->GetBrowserContext())); | 616 Profile::FromBrowserContext(new_contents->GetBrowserContext())); |
616 if (!browser) | 617 if (browser) { |
617 return; | 618 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
618 browser->AddWebContents(new_contents, disposition, initial_pos, user_gesture); | 619 initial_pos, user_gesture); |
| 620 } |
619 } | 621 } |
OLD | NEW |