| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 class CrashNotificationDelegate : public NotificationDelegate { | 97 class CrashNotificationDelegate : public NotificationDelegate { |
| 98 public: | 98 public: |
| 99 CrashNotificationDelegate(Profile* profile, | 99 CrashNotificationDelegate(Profile* profile, |
| 100 const Extension* extension) | 100 const Extension* extension) |
| 101 : profile_(profile), | 101 : profile_(profile), |
| 102 is_hosted_app_(extension->is_hosted_app()), | 102 is_hosted_app_(extension->is_hosted_app()), |
| 103 is_platform_app_(extension->is_platform_app()), | 103 is_platform_app_(extension->is_platform_app()), |
| 104 extension_id_(extension->id()) { | 104 extension_id_(extension->id()) { |
| 105 } | 105 } |
| 106 | 106 |
| 107 void Display() override {} | |
| 108 | |
| 109 void Error() override {} | |
| 110 | |
| 111 void Close(bool by_user) override {} | |
| 112 | |
| 113 void Click() override { | 107 void Click() override { |
| 114 // http://crbug.com/247790 involves a crash notification balloon being | 108 // http://crbug.com/247790 involves a crash notification balloon being |
| 115 // clicked while the extension isn't in the TERMINATED state. In that case, | 109 // clicked while the extension isn't in the TERMINATED state. In that case, |
| 116 // any of the "reload" methods called below can unload the extension, which | 110 // any of the "reload" methods called below can unload the extension, which |
| 117 // indirectly destroys *this, invalidating all the member variables, so we | 111 // indirectly destroys *this, invalidating all the member variables, so we |
| 118 // copy the extension ID before using it. | 112 // copy the extension ID before using it. |
| 119 std::string copied_extension_id = extension_id_; | 113 std::string copied_extension_id = extension_id_; |
| 120 if (is_hosted_app_) { | 114 if (is_hosted_app_) { |
| 121 // There can be a race here: user clicks the balloon, and simultaneously | 115 // There can be a race here: user clicks the balloon, and simultaneously |
| 122 // reloads the sad tab for the app. So we check here to be safe before | 116 // reloads the sad tab for the app. So we check here to be safe before |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 bool user_gesture, | 770 bool user_gesture, |
| 777 bool* was_blocked) { | 771 bool* was_blocked) { |
| 778 Browser* browser = chrome::FindLastActiveWithProfile( | 772 Browser* browser = chrome::FindLastActiveWithProfile( |
| 779 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 773 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
| 780 chrome::GetActiveDesktop()); | 774 chrome::GetActiveDesktop()); |
| 781 if (browser) { | 775 if (browser) { |
| 782 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 776 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
| 783 initial_pos, user_gesture, was_blocked); | 777 initial_pos, user_gesture, was_blocked); |
| 784 } | 778 } |
| 785 } | 779 } |
| OLD | NEW |