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_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/linked_ptr.h" | 11 #include "base/memory/linked_ptr.h" |
12 | 12 |
13 namespace extensions { | 13 namespace extensions { |
14 | 14 |
15 // ExtensionSuggestedLinks contains a list of scored links that the extension | 15 // ExtensionSuggestedLinks contains a list of scored links that the extension |
16 // wants to inject in the NTP's recommended pane. | 16 // wants to inject in the NTP's recommended pane. |
17 class SuggestedLink { | 17 class SuggestedLink { |
18 public: | 18 public: |
19 SuggestedLink(const std::string& link_url_, const std::string& link_text_, | 19 SuggestedLink(const std::string& link_url, const std::string& link_text, |
20 double score); | 20 const std::string& url_image, double score); |
21 ~SuggestedLink(); | 21 ~SuggestedLink(); |
22 | 22 |
23 const std::string& link_url() const { return link_url_; } | 23 const std::string& link_url() const { return link_url_; } |
24 const std::string& link_text() const { return link_text_; } | 24 const std::string& link_text() const { return link_text_; } |
| 25 const std::string& url_image() const { return url_image_; } |
25 double score() const { return score_; } | 26 double score() const { return score_; } |
26 | 27 |
27 private: | 28 private: |
28 std::string link_url_; | 29 std::string link_url_; |
29 std::string link_text_; | 30 std::string link_text_; |
| 31 std::string url_image_; |
30 | 32 |
31 // |score_| is a value between 0 and 1 indicating the relative importance of | 33 // |score_| is a value between 0 and 1 indicating the relative importance of |
32 // this suggested link. A link with score 1 is twice as likely to be presented | 34 // this suggested link. A link with score 1 is twice as likely to be presented |
33 // than one with score 0.5. Use a score of 1 if no information is available on | 35 // than one with score 0.5. Use a score of 1 if no information is available on |
34 // the relative importance of the links. | 36 // the relative importance of the links. |
35 double score_; | 37 double score_; |
36 | 38 |
37 DISALLOW_COPY_AND_ASSIGN(SuggestedLink); | 39 DISALLOW_COPY_AND_ASSIGN(SuggestedLink); |
38 }; | 40 }; |
39 | 41 |
40 } // namespace extensions | 42 } // namespace extensions |
41 | 43 |
42 #endif // CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ | 44 #endif // CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINK_H_ |
OLD | NEW |