| 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 "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 namespace { | 66 namespace { |
| 67 | 67 |
| 68 const char kNotificationPrefix[] = "app.background.crashed."; | 68 const char kNotificationPrefix[] = "app.background.crashed."; |
| 69 | 69 |
| 70 void CloseBalloon(const std::string& balloon_id) { | 70 void CloseBalloon(const std::string& balloon_id) { |
| 71 NotificationUIManager* notification_ui_manager = | 71 NotificationUIManager* notification_ui_manager = |
| 72 g_browser_process->notification_ui_manager(); | 72 g_browser_process->notification_ui_manager(); |
| 73 bool cancelled ALLOW_UNUSED = notification_ui_manager->CancelById(balloon_id); | 73 bool cancelled ALLOW_UNUSED = notification_ui_manager->CancelById(balloon_id); |
| 74 #if defined(ENABLE_NOTIFICATIONS) | 74 #if defined(ENABLE_NOTIFICATIONS) |
| 75 if (cancelled && message_center::IsRichNotificationEnabled()) { | 75 if (cancelled) { |
| 76 // TODO(dewittj): Add this functionality to the notification UI manager's | 76 // TODO(dewittj): Add this functionality to the notification UI manager's |
| 77 // API. | 77 // API. |
| 78 g_browser_process->message_center()->SetVisibility( | 78 g_browser_process->message_center()->SetVisibility( |
| 79 message_center::VISIBILITY_TRANSIENT); | 79 message_center::VISIBILITY_TRANSIENT); |
| 80 } | 80 } |
| 81 #endif | 81 #endif |
| 82 } | 82 } |
| 83 | 83 |
| 84 // Closes the crash notification balloon for the app/extension with this id. | 84 // Closes the crash notification balloon for the app/extension with this id. |
| 85 void ScheduleCloseBalloon(const std::string& extension_id) { | 85 void ScheduleCloseBalloon(const std::string& extension_id) { |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 bool user_gesture, | 786 bool user_gesture, |
| 787 bool* was_blocked) { | 787 bool* was_blocked) { |
| 788 Browser* browser = chrome::FindLastActiveWithProfile( | 788 Browser* browser = chrome::FindLastActiveWithProfile( |
| 789 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 789 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
| 790 chrome::GetActiveDesktop()); | 790 chrome::GetActiveDesktop()); |
| 791 if (browser) { | 791 if (browser) { |
| 792 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 792 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
| 793 initial_pos, user_gesture, was_blocked); | 793 initial_pos, user_gesture, was_blocked); |
| 794 } | 794 } |
| 795 } | 795 } |
| OLD | NEW |