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

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: 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 4232ddcee8d2e7689773dcf84b4dc0794c235c9f..a3b31cd6d81b323aa5bbe406224b5b32d16966c0 100644
--- a/chrome/browser/media/media_stream_capture_indicator.h
+++ b/chrome/browser/media/media_stream_capture_indicator.h
@@ -10,7 +10,6 @@
#include "base/memory/ref_counted.h"
#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"
@@ -22,8 +21,7 @@ class StatusTray;
// is deleted.
class MediaStreamCaptureIndicator
: public base::RefCountedThreadSafe<MediaStreamCaptureIndicator>,
- public ui::SimpleMenuModel::Delegate,
- public ImageLoadingTracker::Observer {
+ public ui::SimpleMenuModel::Delegate {
public:
MediaStreamCaptureIndicator();
@@ -45,11 +43,8 @@ class MediaStreamCaptureIndicator
int render_view_id,
const content::MediaStreamDevices& devices);
- // ImageLoadingTracker::Observer implementation.
- virtual void OnImageLoaded(const gfx::Image& image,
- const std::string& extension_id,
- int index) OVERRIDE;
-
+ // extension_image_utils callback.
+ void OnImageLoaded(const string16& message, const gfx::Image& image);
private:
// Struct to store the usage information of the capture devices for each tab.
// TODO(estade): this should be called CaptureDeviceContents; not all the
@@ -128,9 +123,6 @@ class MediaStreamCaptureIndicator
// 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_;
@@ -145,12 +137,7 @@ class MediaStreamCaptureIndicator
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> icon_tracker_;
};
#endif // CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_

Powered by Google App Engine
This is Rietveld 408576698