| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/custom_home_pages_table_model.h" | 9 #include "chrome/browser/custom_home_pages_table_model.h" |
| 10 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" | 10 #include "chrome/browser/ui/webui/settings/settings_page_ui_handler.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void RenderViewReused() override; | 33 void RenderViewReused() override; |
| 34 | 34 |
| 35 // ui::TableModelObserver: | 35 // ui::TableModelObserver: |
| 36 void OnModelChanged() override; | 36 void OnModelChanged() override; |
| 37 void OnItemsChanged(int start, int length) override; | 37 void OnItemsChanged(int start, int length) override; |
| 38 void OnItemsAdded(int start, int length) override; | 38 void OnItemsAdded(int start, int length) override; |
| 39 void OnItemsRemoved(int start, int length) override; | 39 void OnItemsRemoved(int start, int length) override; |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 // Adds a startup page with the given URL after the given index. | 42 // Adds a startup page with the given URL after the given index. |
| 43 // Called from WebUI. | |
| 44 void HandleAddStartupPage(const base::ListValue* args); | 43 void HandleAddStartupPage(const base::ListValue* args); |
| 45 | 44 |
| 46 // Informs the code that the JS page has loaded. Called from WebUI. | 45 // Changes the startup page at the given index to the given URL. |
| 46 void HandleEditStartupPage(const base::ListValue* args); |
| 47 |
| 48 // Informs the code that the JS page has loaded. |
| 47 void HandleOnStartupPrefsPageLoad(const base::ListValue* args); | 49 void HandleOnStartupPrefsPageLoad(const base::ListValue* args); |
| 48 | 50 |
| 49 // Removes the startup page at the given index. Called from WebUI. | 51 // Removes the startup page at the given index. |
| 50 void HandleRemoveStartupPage(const base::ListValue* args); | 52 void HandleRemoveStartupPage(const base::ListValue* args); |
| 51 | 53 |
| 52 // Sets the startup page set to the current pages. Called from WebUI. | 54 // Sets the startup page set to the current pages. |
| 53 void HandleSetStartupPagesToCurrentPages(const base::ListValue* args); | 55 void HandleSetStartupPagesToCurrentPages(const base::ListValue* args); |
| 54 | 56 |
| 55 // Handles the "validateStartupPage" message. Passed a URL that might be a | 57 // Handles the "validateStartupPage" message. Passed a URL that might be a |
| 56 // valid startup page. | 58 // valid startup page. |
| 57 void HandleValidateStartupPage(const base::ListValue* args); | 59 void HandleValidateStartupPage(const base::ListValue* args); |
| 58 | 60 |
| 59 // Stores the current state of the startup page preferences. | 61 // Stores the current state of the startup page preferences. |
| 60 void SaveStartupPagesPref(); | 62 void SaveStartupPagesPref(); |
| 61 | 63 |
| 62 // Informs the that the preferences have changed. It is a callback | 64 // Informs the that the preferences have changed. It is a callback |
| 63 // for the pref changed registrar. | 65 // for the pref changed registrar. |
| 64 void UpdateStartupPages(); | 66 void UpdateStartupPages(); |
| 65 | 67 |
| 66 // Used to observe updates to the preference of the list of URLs to load | 68 // Used to observe updates to the preference of the list of URLs to load |
| 67 // on startup, which can be updated via sync. | 69 // on startup, which can be updated via sync. |
| 68 PrefChangeRegistrar pref_change_registrar_; | 70 PrefChangeRegistrar pref_change_registrar_; |
| 69 | 71 |
| 70 // The set of pages to launch on startup. | 72 // The set of pages to launch on startup. |
| 71 CustomHomePagesTableModel startup_custom_pages_table_model_; | 73 CustomHomePagesTableModel startup_custom_pages_table_model_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(StartupPagesHandler); | 75 DISALLOW_COPY_AND_ASSIGN(StartupPagesHandler); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace settings | 78 } // namespace settings |
| 77 | 79 |
| 78 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ | 80 #endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SETTINGS_STARTUP_PAGES_HANDLER_H_ |
| OLD | NEW |