| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
| 16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
| 18 #include "chrome/common/extensions/api/extension_action/action_info.h" | 18 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 19 #include "chrome/common/extensions/extension_icon_set.h" | 19 #include "chrome/common/extensions/extension_icon_set.h" |
| 20 #include "third_party/skia/include/core/SkColor.h" | 20 #include "third_party/skia/include/core/SkColor.h" |
| 21 // TODO(robertphillips): change this to "class SkBaseDevice;" |
| 22 #include "third_party/skia/include/core/SkDevice.h" |
| 21 #include "ui/base/animation/linear_animation.h" | 23 #include "ui/base/animation/linear_animation.h" |
| 22 | 24 |
| 23 class GURL; | 25 class GURL; |
| 24 class SkBitmap; | 26 class SkBitmap; |
| 25 class SkDevice; | |
| 26 | 27 |
| 27 namespace gfx { | 28 namespace gfx { |
| 28 class Canvas; | 29 class Canvas; |
| 29 class Image; | 30 class Image; |
| 30 class ImageSkia; | 31 class ImageSkia; |
| 31 class Rect; | 32 class Rect; |
| 32 class Size; | 33 class Size; |
| 33 } | 34 } |
| 34 | 35 |
| 35 // ExtensionAction encapsulates the state of a browser action, page action, or | 36 // ExtensionAction encapsulates the state of a browser action, page action, or |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Construct using ExtensionAction::RunIconAnimation(). | 97 // Construct using ExtensionAction::RunIconAnimation(). |
| 97 friend class ExtensionAction; | 98 friend class ExtensionAction; |
| 98 IconAnimation(); | 99 IconAnimation(); |
| 99 | 100 |
| 100 base::WeakPtr<IconAnimation> AsWeakPtr(); | 101 base::WeakPtr<IconAnimation> AsWeakPtr(); |
| 101 | 102 |
| 102 // ui::LinearAnimation implementation. | 103 // ui::LinearAnimation implementation. |
| 103 virtual void AnimateToState(double state) OVERRIDE; | 104 virtual void AnimateToState(double state) OVERRIDE; |
| 104 | 105 |
| 105 // Device we use to paint icons to. | 106 // Device we use to paint icons to. |
| 106 mutable scoped_ptr<SkDevice> device_; | 107 mutable scoped_ptr<SkBaseDevice> device_; |
| 107 | 108 |
| 108 ObserverList<Observer> observers_; | 109 ObserverList<Observer> observers_; |
| 109 | 110 |
| 110 base::WeakPtrFactory<IconAnimation> weak_ptr_factory_; | 111 base::WeakPtrFactory<IconAnimation> weak_ptr_factory_; |
| 111 | 112 |
| 112 DISALLOW_COPY_AND_ASSIGN(IconAnimation); | 113 DISALLOW_COPY_AND_ASSIGN(IconAnimation); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 ExtensionAction(const std::string& extension_id, | 116 ExtensionAction(const std::string& extension_id, |
| 116 extensions::ActionInfo::Type action_type, | 117 extensions::ActionInfo::Type action_type, |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 }; | 369 }; |
| 369 | 370 |
| 370 template<> | 371 template<> |
| 371 struct ExtensionAction::ValueTraits<int> { | 372 struct ExtensionAction::ValueTraits<int> { |
| 372 static int CreateEmpty() { | 373 static int CreateEmpty() { |
| 373 return -1; | 374 return -1; |
| 374 } | 375 } |
| 375 }; | 376 }; |
| 376 | 377 |
| 377 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ | 378 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ACTION_H_ |
| OLD | NEW |