OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2011 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_UI_WEBUI_OPTIONS_INTENTS_SETTINGS_HANDLER_H_ | |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_INTENTS_SETTINGS_HANDLER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "chrome/browser/ui/intents/intents_model.h" | |
12 #include "chrome/browser/ui/webui/options/options_ui.h" | |
13 | |
14 class WebDataService; | |
15 class WebIntentsRegistry; | |
16 | |
17 class IntentsSettingsHandler : public OptionsPageUIHandler, | |
James Hawkins
2011/08/17 21:34:15
Document the class.
Greg Billock
2011/08/17 22:44:02
Done.
| |
18 public IntentsModel::Observer { | |
19 public: | |
20 IntentsSettingsHandler(); | |
21 virtual ~IntentsSettingsHandler(); | |
22 | |
23 // OptionsPageUIHandler implementation. | |
24 virtual void GetLocalizedValues(base::DictionaryValue* localized_strings); | |
25 virtual void RegisterMessages(); | |
26 | |
27 // IntentsModel::Observer implementation. | |
28 virtual void TreeNodesAdded(ui::TreeModel* model, | |
29 ui::TreeModelNode* parent, | |
30 int start, | |
31 int count) OVERRIDE; | |
32 virtual void TreeNodesRemoved(ui::TreeModel* model, | |
33 ui::TreeModelNode* parent, | |
34 int start, | |
35 int count) OVERRIDE; | |
36 virtual void TreeNodeChanged(ui::TreeModel* model, | |
37 ui::TreeModelNode* node) OVERRIDE {} | |
38 virtual void TreeModelBeginBatch(IntentsModel* model) OVERRIDE; | |
39 virtual void TreeModelEndBatch(IntentsModel* model) OVERRIDE; | |
40 | |
41 private: | |
42 // Creates the IntentsModel if neccessary. | |
43 void EnsureIntentsModelCreated(); | |
44 | |
45 // Updates search filter for cookies tree model. | |
46 void UpdateSearchResults(const base::ListValue* args); | |
47 | |
48 // Remove all sites data. | |
49 void RemoveAll(const base::ListValue* args); | |
50 | |
51 // Remove selected sites data. | |
52 void RemoveIntent(const base::ListValue* args); | |
53 | |
54 // Helper functions for removals. | |
55 void RemoveOrigin(IntentsTreeNode* node); | |
56 void RemoveService(ServiceTreeNode* snode); | |
57 | |
58 // Trigger for SendChildren to load the JS model. | |
59 void LoadChildren(const base::ListValue* args); | |
60 | |
61 // Get children nodes data and pass it to 'IntentsView.loadChildren' to | |
62 // update the WebUI. | |
63 void SendChildren(IntentsTreeNode* parent); | |
64 | |
65 // The Intents model | |
66 scoped_refptr<WebDataService> web_data_service_; | |
67 WebIntentsRegistry* web_intents_registry_; // not owned | |
68 scoped_ptr<IntentsModel> intents_tree_model_; | |
69 | |
70 // Flag to indicate whether there is a batch update in progress. | |
71 bool batch_update_; | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(IntentsSettingsHandler); | |
74 }; | |
75 | |
76 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_INTENTS_SETTINGS_HANDLER_H_ | |
OLD | NEW |