| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDROID
_H_ | 5 #ifndef CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDROID
_H_ |
| 6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDROID
_H_ | 6 #define CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDROID
_H_ |
| 7 | 7 |
| 8 #include "components/enhanced_bookmarks/bookmark_image_service.h" | 8 #include "components/enhanced_bookmarks/bookmark_image_service.h" |
| 9 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" | 9 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" |
| 10 | 10 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // image. If it is, invokes RetrieveSalientImageFromContext() for the relevant | 43 // image. If it is, invokes RetrieveSalientImageFromContext() for the relevant |
| 44 // urls. | 44 // urls. |
| 45 void FinishSuccessfulPageLoadForTab(content::WebContents* web_contents, | 45 void FinishSuccessfulPageLoadForTab(content::WebContents* web_contents, |
| 46 bool update_bookmark); | 46 bool update_bookmark); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void RetrieveSalientImageFromContextCallback(const GURL& page_url, | 49 void RetrieveSalientImageFromContextCallback(const GURL& page_url, |
| 50 bool update_bookmark, | 50 bool update_bookmark, |
| 51 const base::Value* result); | 51 const base::Value* result); |
| 52 | 52 |
| 53 gfx::Image ResizeImage(gfx::Image image) override; | 53 scoped_ptr<gfx::Image> ResizeImage(const gfx::Image& image) override; |
| 54 | 54 |
| 55 content::BrowserContext* browser_context_; | 55 content::BrowserContext* browser_context_; |
| 56 // The script injected in a page to extract image urls. | 56 // The script injected in a page to extract image urls. |
| 57 base::string16 script_; | 57 base::string16 script_; |
| 58 // Maximum size for retrieved salient images in pixels. This is used when | 58 // Maximum size for retrieved salient images in pixels. This is used when |
| 59 // resizing an image. | 59 // resizing an image. |
| 60 gfx::Size max_size_; | 60 gfx::Size max_size_; |
| 61 | 61 |
| 62 class BitmapFetcherHandler : private chrome::BitmapFetcherDelegate { | 62 class BitmapFetcherHandler : private chrome::BitmapFetcherDelegate { |
| 63 public: | 63 public: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 83 | 83 |
| 84 DISALLOW_COPY_AND_ASSIGN(BitmapFetcherHandler); | 84 DISALLOW_COPY_AND_ASSIGN(BitmapFetcherHandler); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(BookmarkImageServiceAndroid); | 87 DISALLOW_COPY_AND_ASSIGN(BookmarkImageServiceAndroid); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace enhanced_bookmarks | 90 } // namespace enhanced_bookmarks |
| 91 | 91 |
| 92 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDR
OID_H_ | 92 #endif // CHROME_BROWSER_ENHANCED_BOOKMARKS_ANDROID_BOOKMARK_IMAGE_SERVICE_ANDR
OID_H_ |
| OLD | NEW |