Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2494)

Unified Diff: chrome/browser/media/media_stream_capture_indicator.h

Issue 11027044: Add a class to replace ImageLoadingTracker with a nicer API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove unused code Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/media_stream_capture_indicator.h
diff --git a/chrome/browser/media/media_stream_capture_indicator.h b/chrome/browser/media/media_stream_capture_indicator.h
index 6132f86443750672b5bd60a401ebfef549461cd9..bb26f917d6157d16bdbe18044c9fc7f410bf80a2 100644
--- a/chrome/browser/media/media_stream_capture_indicator.h
+++ b/chrome/browser/media/media_stream_capture_indicator.h
@@ -9,7 +9,6 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/extensions/image_loading_tracker.h"
#include "content/public/common/media_stream_request.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/gfx/image/image_skia.h"
@@ -19,8 +18,7 @@ class StatusTray;
// This indicator is owned by MediaInternals and deleted when MediaInternals
// is deleted.
-class MediaStreamCaptureIndicator : public ui::SimpleMenuModel::Delegate,
- public ImageLoadingTracker::Observer {
+class MediaStreamCaptureIndicator : public ui::SimpleMenuModel::Delegate {
public:
MediaStreamCaptureIndicator();
virtual ~MediaStreamCaptureIndicator();
@@ -46,10 +44,8 @@ class MediaStreamCaptureIndicator : public ui::SimpleMenuModel::Delegate,
// Returns true if the render process is capturing media.
bool IsProcessCapturing(int render_process_id, int render_view_id) const;
- // ImageLoadingTracker::Observer implementation.
- virtual void OnImageLoaded(const gfx::Image& image,
- const std::string& extension_id,
- int index) OVERRIDE;
+ // ImageLoader callback.
+ void OnImageLoaded(const string16& message, const gfx::Image& image);
private:
// Struct to store the usage information of the capture devices for each tab.
@@ -126,9 +122,6 @@ class MediaStreamCaptureIndicator : public ui::SimpleMenuModel::Delegate,
// UpdateStatusTrayIconContextMenu().
void UpdateStatusTrayIconDisplay(bool audio, bool video);
- // Initializes image loading state.
- void EnsureImageLoadingTracker();
-
// Reference to our status icon - owned by the StatusTray. If null,
// the platform doesn't support status icons.
StatusIcon* status_icon_;
@@ -142,15 +135,8 @@ class MediaStreamCaptureIndicator : public ui::SimpleMenuModel::Delegate,
typedef std::vector<CaptureDeviceTab> CaptureDeviceTabs;
CaptureDeviceTabs tabs_;
- // Tracks the load of extension icons.
- scoped_ptr<ImageLoadingTracker> tracker_;
- // The messages to display when extension images are loaded. The index
- // corresponds to the index of the associated LoadImage request.
- std::map<int, string16> pending_messages_;
- // Tracks the number of requests to |tracker_|.
- int request_index_;
-
base::WeakPtrFactory<MediaStreamCaptureIndicator> weak_ptr_factory_;
+ base::WeakPtrFactory<MediaStreamCaptureIndicator> icon_tracker_;
DISALLOW_COPY_AND_ASSIGN(MediaStreamCaptureIndicator);
};

Powered by Google App Engine
This is Rietveld 408576698