summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_sidebar_defaults.h
blob: 4e475a45a7231dbcb994c3e978b40a26f9826559 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_
#define CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_
#pragma once

#include <string>

#include "base/string16.h"
#include "googleurl/src/gurl.h"

// ExtensionSidebarDefaults encapsulates the default parameters of a sidebar,
// as defined in the extension manifest.
class ExtensionSidebarDefaults {
 public:
  // Default title, stores manifest default_title key value.
  void set_default_title(const string16& title) {
    default_title_ = title;
  }
  const string16& default_title() const { return default_title_; }

  // Default icon path, stores manifest default_icon key value.
  void set_default_icon_path(const std::string& path) {
    default_icon_path_ = path;
  }
  const std::string& default_icon_path() const {
    return default_icon_path_;
  }

  // A resolved |url| to extension resource (manifest default_page key value)
  // to navigate sidebar to by default.
  void set_default_page(const GURL& url) {
    default_page_ = url;
  }
  const GURL& default_page() const {
    return default_page_;
  }

 private:
  string16 default_title_;
  std::string default_icon_path_;
  GURL default_page_;
};

#endif  // CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_