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_UI_METRO_PIN_TAB_HELPER_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_ |
6 #define CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_ | 6 #define CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "content/public/browser/web_contents_observer.h" | 10 #include "content/public/browser/web_contents_observer.h" |
11 #include "content/public/browser/web_contents_user_data.h" | 11 #include "content/public/browser/web_contents_user_data.h" |
12 #include "content/public/common/favicon_url.h" | 12 #include "content/public/common/favicon_url.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "ui/gfx/image/image_skia.h" | 14 #include "ui/gfx/image/image_skia.h" |
15 | 15 |
16 namespace gfx { | 16 namespace gfx { |
17 class Size; | 17 class Size; |
18 } | 18 } |
19 | 19 |
20 // Per-tab class to help manage metro pinning. | 20 // Per-tab class to help manage metro pinning. |
21 class MetroPinTabHelper | 21 class MetroPinTabHelper |
22 : public content::WebContentsObserver, | 22 : public content::WebContentsObserver, |
23 public content::WebContentsUserData<MetroPinTabHelper> { | 23 public content::WebContentsUserData<MetroPinTabHelper> { |
24 public: | 24 public: |
25 virtual ~MetroPinTabHelper(); | 25 ~MetroPinTabHelper() override; |
26 | 26 |
27 bool IsPinned() const; | 27 bool IsPinned() const; |
28 | 28 |
29 void TogglePinnedToStartScreen(); | 29 void TogglePinnedToStartScreen(); |
30 | 30 |
31 // content::WebContentsObserver overrides: | 31 // content::WebContentsObserver overrides: |
32 virtual void DidNavigateMainFrame( | 32 void DidNavigateMainFrame( |
33 const content::LoadCommittedDetails& details, | 33 const content::LoadCommittedDetails& details, |
34 const content::FrameNavigateParams& params) override; | 34 const content::FrameNavigateParams& params) override; |
35 virtual void DidUpdateFaviconURL( | 35 void DidUpdateFaviconURL( |
36 const std::vector<content::FaviconURL>& candidates) override; | 36 const std::vector<content::FaviconURL>& candidates) override; |
37 | 37 |
38 private: | 38 private: |
39 // The FaviconDownloader class handles downloading the favicons when a page | 39 // The FaviconDownloader class handles downloading the favicons when a page |
40 // is being pinned. After it has downloaded any available favicons it will | 40 // is being pinned. After it has downloaded any available favicons it will |
41 // continue on with the page pinning action. | 41 // continue on with the page pinning action. |
42 class FaviconChooser; | 42 class FaviconChooser; |
43 | 43 |
44 explicit MetroPinTabHelper(content::WebContents* web_contents); | 44 explicit MetroPinTabHelper(content::WebContents* web_contents); |
45 friend class content::WebContentsUserData<MetroPinTabHelper>; | 45 friend class content::WebContentsUserData<MetroPinTabHelper>; |
(...skipping 14 matching lines...) Expand all Loading... |
60 std::vector<content::FaviconURL> favicon_url_candidates_; | 60 std::vector<content::FaviconURL> favicon_url_candidates_; |
61 | 61 |
62 // The currently active FaviconChooser, if there is one. | 62 // The currently active FaviconChooser, if there is one. |
63 scoped_ptr<FaviconChooser> favicon_chooser_; | 63 scoped_ptr<FaviconChooser> favicon_chooser_; |
64 | 64 |
65 | 65 |
66 DISALLOW_COPY_AND_ASSIGN(MetroPinTabHelper); | 66 DISALLOW_COPY_AND_ASSIGN(MetroPinTabHelper); |
67 }; | 67 }; |
68 | 68 |
69 #endif // CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_ | 69 #endif // CHROME_BROWSER_UI_METRO_PIN_TAB_HELPER_WIN_H_ |
OLD | NEW |