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