| Index: chrome/browser/ui/metro_pin_tab_helper_win.h
|
| diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.h b/chrome/browser/ui/metro_pin_tab_helper_win.h
|
| index 3cb2532d508e522f64aeee602d4f474b90dfb5ba..77a81a7b74887f3db0eedf8ce11a08ca9e078851 100644
|
| --- a/chrome/browser/ui/metro_pin_tab_helper_win.h
|
| +++ b/chrome/browser/ui/metro_pin_tab_helper_win.h
|
| @@ -5,8 +5,12 @@
|
| #ifndef CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_
|
| #define CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_
|
|
|
| +#include <vector>
|
| +
|
| +#include "chrome/common/favicon_url.h"
|
| #include "content/public/browser/web_contents_observer.h"
|
| #include "content/public/browser/web_contents_user_data.h"
|
| +#include "third_party/skia/include/core/SkBitmap.h"
|
| #include "ui/gfx/image/image_skia.h"
|
|
|
| // Per-tab class to help manage metro pinning.
|
| @@ -25,24 +29,42 @@ class MetroPinTabHelper
|
| const content::LoadCommittedDetails& details,
|
| const content::FrameNavigateParams& params) OVERRIDE;
|
|
|
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
| +
|
| private:
|
| - // The TaskRunner handles running tasks for this helper on the FILE thread.
|
| - class TaskRunner;
|
| + // The FaviconDownloader class handles downloading the favicons when a page
|
| + // is being pinned. After it has downloaded any available favicons it will
|
| + // continue on with the page pinning action.
|
| + class FaviconDownloader;
|
|
|
| explicit MetroPinTabHelper(content::WebContents* tab_contents);
|
| friend class content::WebContentsUserData<MetroPinTabHelper>;
|
|
|
| + // Message Handlers.
|
| + void OnUpdateFaviconURL(int32 page_id,
|
| + const std::vector<FaviconURL>& candidates);
|
| + void OnDidDownloadFavicon(int id,
|
| + const GURL& image_url,
|
| + bool errored,
|
| + int requested_size,
|
| + const std::vector<SkBitmap>& bitmaps);
|
| +
|
| // Queries the metro driver about the pinned state of the current URL.
|
| void UpdatePinnedStateForCurrentURL();
|
|
|
| void UnPinPageFromStartScreen();
|
|
|
| + // Called by the |favicon_downloader_| when it has finished.
|
| + void FaviconDownloaderFinished();
|
| +
|
| // Whether the current URL is pinned to the metro start screen.
|
| bool is_pinned_;
|
|
|
| - // The task runner for the helper, which runs things for it on the FILE
|
| - // thread.
|
| - scoped_refptr<TaskRunner> task_runner_;
|
| + // Candidate Favicon URLs for the current page.
|
| + std::vector<FaviconURL> favicon_url_candidates_;
|
| +
|
| + // The currently active FaviconDownloader, if there is one.
|
| + scoped_ptr<FaviconDownloader> favicon_downloader_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MetroPinTabHelper);
|
| };
|
|
|