OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/string16.h" | 11 #include "base/string16.h" |
12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
13 | 13 |
14 class SkBitmap; | |
15 | |
16 // ExtensionSidebarDefaults encapsulates the default parameters of a sidebar, | 14 // ExtensionSidebarDefaults encapsulates the default parameters of a sidebar, |
17 // as defined in the extension manifest. | 15 // as defined in the extension manifest. |
18 class ExtensionSidebarDefaults { | 16 class ExtensionSidebarDefaults { |
19 public: | 17 public: |
20 // Default title, stores manifest default_title key value. | 18 // Default title, stores manifest default_title key value. |
21 void set_default_title(const string16& title) { | 19 void set_default_title(const string16& title) { |
22 default_title_ = title; | 20 default_title_ = title; |
23 } | 21 } |
24 const string16& default_title() const { return default_title_; } | 22 const string16& default_title() const { return default_title_; } |
25 | 23 |
26 // Default icon path, stores manifest default_icon key value. | 24 // Default icon path, stores manifest default_icon key value. |
27 void set_default_icon_path(const std::string& path) { | 25 void set_default_icon_path(const std::string& path) { |
28 default_icon_path_ = path; | 26 default_icon_path_ = path; |
29 } | 27 } |
30 const std::string& default_icon_path() const { | 28 const std::string& default_icon_path() const { |
31 return default_icon_path_; | 29 return default_icon_path_; |
32 } | 30 } |
33 | 31 |
34 // Default sidebar url, resolved and verified against extension permissions. | 32 // A resolved |url| to extension resource (manifest default_page key value) |
35 void set_default_url(const GURL& url) { | 33 // to navigate sidebar to by default. |
36 default_url_ = url; | 34 void set_default_page(const GURL& url) { |
| 35 default_page_ = url; |
37 } | 36 } |
38 const GURL& default_url() const { | 37 const GURL& default_page() const { |
39 return default_url_; | 38 return default_page_; |
40 } | 39 } |
41 | 40 |
42 private: | 41 private: |
43 string16 default_title_; | 42 string16 default_title_; |
44 std::string default_icon_path_; | 43 std::string default_icon_path_; |
45 GURL default_url_; | 44 GURL default_page_; |
46 }; | 45 }; |
47 | 46 |
48 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ | 47 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_SIDEBAR_DEFAULTS_H_ |
OLD | NEW |