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/extensions/api/notifications/notifications_api.h" | 5 #include "chrome/browser/extensions/api/notifications/notifications_api.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 const gfx::ImageSkia masked_small_image = | 99 const gfx::ImageSkia masked_small_image = |
100 gfx::ImageSkiaOperations::CreateMaskedImage(foreground, small_image); | 100 gfx::ImageSkiaOperations::CreateMaskedImage(foreground, small_image); |
101 return gfx::Image(gfx::ImageSkiaOperations::CreateSuperimposedImage( | 101 return gfx::Image(gfx::ImageSkiaOperations::CreateSuperimposedImage( |
102 background, masked_small_image)); | 102 background, masked_small_image)); |
103 } | 103 } |
104 | 104 |
105 class ShutdownNotifierFactory | 105 class ShutdownNotifierFactory |
106 : public BrowserContextKeyedServiceShutdownNotifierFactory { | 106 : public BrowserContextKeyedServiceShutdownNotifierFactory { |
107 public: | 107 public: |
108 static ShutdownNotifierFactory* GetInstance() { | 108 static ShutdownNotifierFactory* GetInstance() { |
109 return Singleton<ShutdownNotifierFactory>::get(); | 109 return base::Singleton<ShutdownNotifierFactory>::get(); |
110 } | 110 } |
111 | 111 |
112 private: | 112 private: |
113 friend struct DefaultSingletonTraits<ShutdownNotifierFactory>; | 113 friend struct base::DefaultSingletonTraits<ShutdownNotifierFactory>; |
114 | 114 |
115 ShutdownNotifierFactory() | 115 ShutdownNotifierFactory() |
116 : BrowserContextKeyedServiceShutdownNotifierFactory( | 116 : BrowserContextKeyedServiceShutdownNotifierFactory( |
117 "NotificationsApiDelegate") { | 117 "NotificationsApiDelegate") { |
118 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 118 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
119 } | 119 } |
120 ~ShutdownNotifierFactory() override {} | 120 ~ShutdownNotifierFactory() override {} |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); | 122 DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); |
123 }; | 123 }; |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 ? api::notifications::PERMISSION_LEVEL_GRANTED | 680 ? api::notifications::PERMISSION_LEVEL_GRANTED |
681 : api::notifications::PERMISSION_LEVEL_DENIED; | 681 : api::notifications::PERMISSION_LEVEL_DENIED; |
682 | 682 |
683 SetResult(new base::StringValue(api::notifications::ToString(result))); | 683 SetResult(new base::StringValue(api::notifications::ToString(result))); |
684 SendResponse(true); | 684 SendResponse(true); |
685 | 685 |
686 return true; | 686 return true; |
687 } | 687 } |
688 | 688 |
689 } // namespace extensions | 689 } // namespace extensions |
OLD | NEW |