OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 void AddSupportedLocale(const std::string& supported_locale) { | 255 void AddSupportedLocale(const std::string& supported_locale) { |
256 supported_locales_.insert(supported_locale); | 256 supported_locales_.insert(supported_locale); |
257 } | 257 } |
258 | 258 |
259 // Getter/setter for a default_locale_. | 259 // Getter/setter for a default_locale_. |
260 const std::string& default_locale() const { return default_locale_; } | 260 const std::string& default_locale() const { return default_locale_; } |
261 void set_default_locale(const std::string& default_locale) { | 261 void set_default_locale(const std::string& default_locale) { |
262 default_locale_ = default_locale; | 262 default_locale_ = default_locale; |
263 } | 263 } |
264 | 264 |
| 265 // Chrome URL overrides (see ExtensionOverrideUI). |
| 266 DictionaryValue* GetChromeURLOverrides() const { |
| 267 return chrome_url_overrides_.get(); |
| 268 } |
| 269 |
265 // Runtime data: | 270 // Runtime data: |
266 // Put dynamic data about the state of a running extension below. | 271 // Put dynamic data about the state of a running extension below. |
267 | 272 |
268 // Whether the background page, if any, is ready. We don't load other | 273 // Whether the background page, if any, is ready. We don't load other |
269 // components until then. If there is no background page, we consider it to | 274 // components until then. If there is no background page, we consider it to |
270 // be ready. | 275 // be ready. |
271 bool GetBackgroundPageReady(); | 276 bool GetBackgroundPageReady(); |
272 void SetBackgroundPageReady(); | 277 void SetBackgroundPageReady(); |
273 | 278 |
274 private: | 279 private: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 380 |
376 // A copy of the manifest that this extension was created from. | 381 // A copy of the manifest that this extension was created from. |
377 scoped_ptr<DictionaryValue> manifest_value_; | 382 scoped_ptr<DictionaryValue> manifest_value_; |
378 | 383 |
379 // List of all locales extension supports. | 384 // List of all locales extension supports. |
380 std::set<std::string> supported_locales_; | 385 std::set<std::string> supported_locales_; |
381 | 386 |
382 // Default locale, used for fallback. | 387 // Default locale, used for fallback. |
383 std::string default_locale_; | 388 std::string default_locale_; |
384 | 389 |
| 390 // A map of chrome:// hostnames (newtab, downloads, etc.) to Extension URLs |
| 391 // which override the handling of those URLs. |
| 392 scoped_ptr<DictionaryValue> chrome_url_overrides_; |
| 393 |
385 // Runtime data: | 394 // Runtime data: |
386 | 395 |
387 // True if the background page is ready. | 396 // True if the background page is ready. |
388 bool background_page_ready_; | 397 bool background_page_ready_; |
389 | 398 |
390 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); | 399 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); |
391 | 400 |
392 DISALLOW_COPY_AND_ASSIGN(Extension); | 401 DISALLOW_COPY_AND_ASSIGN(Extension); |
393 }; | 402 }; |
394 | 403 |
395 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 404 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |