| Index: apps/app_shim/app_shim_handler_mac.cc
|
| diff --git a/apps/app_shim/app_shim_handler_mac.cc b/apps/app_shim/app_shim_handler_mac.cc
|
| index 18cca9242674fbf4a19bb1d1d65e7704234e3bfe..6076557710a7a1e7644139931643bfd52ffaab81 100644
|
| --- a/apps/app_shim/app_shim_handler_mac.cc
|
| +++ b/apps/app_shim/app_shim_handler_mac.cc
|
| @@ -25,7 +25,7 @@ class AppShimHandlerRegistry {
|
| if (it != handlers_.end())
|
| return it->second;
|
|
|
| - return NULL;
|
| + return default_handler_;
|
| }
|
|
|
| bool SetForAppMode(const std::string& app_mode_id, AppShimHandler* handler) {
|
| @@ -36,14 +36,20 @@ class AppShimHandlerRegistry {
|
| return inserted_or_removed;
|
| }
|
|
|
| + void SetDefaultHandler(AppShimHandler* handler) {
|
| + DCHECK_NE(default_handler_ == NULL, handler == NULL);
|
| + default_handler_ = handler;
|
| + }
|
| +
|
| private:
|
| friend struct DefaultSingletonTraits<AppShimHandlerRegistry>;
|
| typedef std::map<std::string, AppShimHandler*> HandlerMap;
|
|
|
| - AppShimHandlerRegistry() {}
|
| + AppShimHandlerRegistry() : default_handler_(NULL) {}
|
| ~AppShimHandlerRegistry() {}
|
|
|
| HandlerMap handlers_;
|
| + AppShimHandler* default_handler_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(AppShimHandlerRegistry);
|
| };
|
| @@ -67,4 +73,9 @@ AppShimHandler* AppShimHandler::GetForAppMode(const std::string& app_mode_id) {
|
| return AppShimHandlerRegistry::GetInstance()->GetForAppMode(app_mode_id);
|
| }
|
|
|
| +// static
|
| +void AppShimHandler::SetDefaultHandler(AppShimHandler* handler) {
|
| + AppShimHandlerRegistry::GetInstance()->SetDefaultHandler(handler);
|
| +}
|
| +
|
| } // namespace apps
|
|
|