Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/common/extensions/manifest_handlers/settings_overrides_handler.h

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER_H_
6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER_H_ 6 #define CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "chrome/common/extensions/api/manifest_types.h" 11 #include "chrome/common/extensions/api/manifest_types.h"
10 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
11 #include "extensions/common/manifest_handler.h" 13 #include "extensions/common/manifest_handler.h"
12 14
13 namespace extensions { 15 namespace extensions {
14 16
15 enum SettingsApiOverrideType { 17 enum SettingsApiOverrideType {
16 BUBBLE_TYPE_HOME_PAGE = 0, 18 BUBBLE_TYPE_HOME_PAGE = 0,
17 BUBBLE_TYPE_SEARCH_ENGINE, 19 BUBBLE_TYPE_SEARCH_ENGINE,
18 BUBBLE_TYPE_STARTUP_PAGES, 20 BUBBLE_TYPE_STARTUP_PAGES,
19 }; 21 };
20 22
21 class ManifestPermission; 23 class ManifestPermission;
22 24
23 // SettingsOverride is associated with "chrome_settings_overrides" manifest key. 25 // SettingsOverride is associated with "chrome_settings_overrides" manifest key.
24 // An extension can add a search engine as default or non-default, overwrite the 26 // An extension can add a search engine as default or non-default, overwrite the
25 // homepage and append a startup page to the list. 27 // homepage and append a startup page to the list.
26 struct SettingsOverrides : public Extension::ManifestData { 28 struct SettingsOverrides : public Extension::ManifestData {
27 SettingsOverrides(); 29 SettingsOverrides();
28 ~SettingsOverrides() override; 30 ~SettingsOverrides() override;
29 31
30 static const SettingsOverrides* Get(const Extension* extension); 32 static const SettingsOverrides* Get(const Extension* extension);
31 33
32 scoped_ptr<api::manifest_types::ChromeSettingsOverrides::Search_provider> 34 std::unique_ptr<api::manifest_types::ChromeSettingsOverrides::Search_provider>
33 search_engine; 35 search_engine;
34 scoped_ptr<GURL> homepage; 36 std::unique_ptr<GURL> homepage;
35 std::vector<GURL> startup_pages; 37 std::vector<GURL> startup_pages;
36 38
37 private: 39 private:
38 DISALLOW_COPY_AND_ASSIGN(SettingsOverrides); 40 DISALLOW_COPY_AND_ASSIGN(SettingsOverrides);
39 }; 41 };
40 42
41 class SettingsOverridesHandler : public ManifestHandler { 43 class SettingsOverridesHandler : public ManifestHandler {
42 public: 44 public:
43 SettingsOverridesHandler(); 45 SettingsOverridesHandler();
44 ~SettingsOverridesHandler() override; 46 ~SettingsOverridesHandler() override;
45 47
46 bool Parse(Extension* extension, base::string16* error) override; 48 bool Parse(Extension* extension, base::string16* error) override;
47 49
48 private: 50 private:
49 const std::vector<std::string> Keys() const override; 51 const std::vector<std::string> Keys() const override;
50 52
51 DISALLOW_COPY_AND_ASSIGN(SettingsOverridesHandler); 53 DISALLOW_COPY_AND_ASSIGN(SettingsOverridesHandler);
52 }; 54 };
53 55
54 } // namespace extensions 56 } // namespace extensions
55 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER _H_ 57 #endif // CHROME_COMMON_EXTENSIONS_MANIFEST_HANDLERS_SETTINGS_OVERRIDES_HANDLER _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698