| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/apps/app_shim/app_shim_handler_mac.h" | 5 #include "chrome/browser/apps/app_shim/app_shim_handler_mac.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, | 90 this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, |
| 91 content::NotificationService::AllBrowserContextsAndSources()); | 91 content::NotificationService::AllBrowserContextsAndSources()); |
| 92 } | 92 } |
| 93 | 93 |
| 94 virtual ~AppShimHandlerRegistry() {} | 94 virtual ~AppShimHandlerRegistry() {} |
| 95 | 95 |
| 96 // content::NotificationObserver override: | 96 // content::NotificationObserver override: |
| 97 virtual void Observe( | 97 virtual void Observe( |
| 98 int type, | 98 int type, |
| 99 const content::NotificationSource& source, | 99 const content::NotificationSource& source, |
| 100 const content::NotificationDetails& details) OVERRIDE { | 100 const content::NotificationDetails& details) override { |
| 101 switch (type) { | 101 switch (type) { |
| 102 case chrome::NOTIFICATION_BROWSER_OPENED: | 102 case chrome::NOTIFICATION_BROWSER_OPENED: |
| 103 case chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED: | 103 case chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED: |
| 104 browser_session_running_ = true; | 104 browser_session_running_ = true; |
| 105 break; | 105 break; |
| 106 case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: | 106 case chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST: |
| 107 browser_session_running_ = false; | 107 browser_session_running_ = false; |
| 108 break; | 108 break; |
| 109 default: | 109 default: |
| 110 NOTREACHED(); | 110 NOTREACHED(); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 void AppShimHandler::MaybeTerminate() { | 147 void AppShimHandler::MaybeTerminate() { |
| 148 AppShimHandlerRegistry::GetInstance()->MaybeTerminate(); | 148 AppShimHandlerRegistry::GetInstance()->MaybeTerminate(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 // static | 151 // static |
| 152 bool AppShimHandler::ShouldRestoreSession() { | 152 bool AppShimHandler::ShouldRestoreSession() { |
| 153 return AppShimHandlerRegistry::GetInstance()->ShouldRestoreSession(); | 153 return AppShimHandlerRegistry::GetInstance()->ShouldRestoreSession(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace apps | 156 } // namespace apps |
| OLD | NEW |