diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 13:12:55 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 13:12:55 +0000 |
commit | b951126a0de1c6b5d5436fdf7ad0588dcd2bbc14 (patch) | |
tree | 6f1fa29b98c7eec1dcc4e4cdc8d72b9175afeb7c | |
parent | 44f6e3d20a74eabde6331cf329979469af8afc88 (diff) | |
download | chromium_src-b951126a0de1c6b5d5436fdf7ad0588dcd2bbc14.zip chromium_src-b951126a0de1c6b5d5436fdf7ad0588dcd2bbc14.tar.gz chromium_src-b951126a0de1c6b5d5436fdf7ad0588dcd2bbc14.tar.bz2 |
Ensure that cookies dialog is populated with new cookies on reload
BUG=125643
TEST=Ensure that the cookies dialog is still fully functional; also see bug report
Review URL: https://chromiumcodereview.appspot.com/10830221
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150783 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/options2/cookies_view.js | 8 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options2/cookies_view_handler.cc | 10 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options2/cookies_view_handler.h | 4 |
3 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/resources/options2/cookies_view.js b/chrome/browser/resources/options2/cookies_view.js index 2e04f4d..c80b93f 100644 --- a/chrome/browser/resources/options2/cookies_view.js +++ b/chrome/browser/resources/options2/cookies_view.js @@ -32,11 +32,11 @@ cr.define('options', function() { queryDelayTimerId_: 0, /** - * The most recent search query, or null if the query is empty. - * @type {?string} + * The most recent search query, empty string if the query is empty. + * @type {string} * @private */ - lastQuery_: null, + lastQuery_: '', initializePage: function() { OptionsPage.prototype.initializePage.call(this); @@ -106,6 +106,8 @@ cr.define('options', function() { // cookies dialog or the apps one. chrome.send('setViewContext', [this.isAppContext()]); + chrome.send('reloadCookies'); + if (!this.initialized_) { this.initialized_ = true; this.searchCookie(); diff --git a/chrome/browser/ui/webui/options2/cookies_view_handler.cc b/chrome/browser/ui/webui/options2/cookies_view_handler.cc index 2a7c3c2..82ef5bb 100644 --- a/chrome/browser/ui/webui/options2/cookies_view_handler.cc +++ b/chrome/browser/ui/webui/options2/cookies_view_handler.cc @@ -120,6 +120,9 @@ void CookiesViewHandler::RegisterMessages() { web_ui()->RegisterMessageCallback("setViewContext", base::Bind(&CookiesViewHandler::SetViewContext, base::Unretained(this))); + web_ui()->RegisterMessageCallback("reloadCookies", + base::Bind(&CookiesViewHandler::ReloadCookies, + base::Unretained(this))); } void CookiesViewHandler::TreeNodesAdded(ui::TreeModel* model, @@ -295,6 +298,13 @@ void CookiesViewHandler::SetViewContext(const base::ListValue* args) { app_context_ = app_context; } +void CookiesViewHandler::ReloadCookies(const base::ListValue* args) { + cookies_tree_model_.reset(); + app_cookies_tree_model_.reset(); + + EnsureCookiesTreeModelCreated(); +} + CookiesTreeModel* CookiesViewHandler::GetTreeModel() { CookiesTreeModel* model = app_context_ ? app_cookies_tree_model_.get() : cookies_tree_model_.get(); diff --git a/chrome/browser/ui/webui/options2/cookies_view_handler.h b/chrome/browser/ui/webui/options2/cookies_view_handler.h index 6665099..479856f 100644 --- a/chrome/browser/ui/webui/options2/cookies_view_handler.h +++ b/chrome/browser/ui/webui/options2/cookies_view_handler.h @@ -64,6 +64,10 @@ class CookiesViewHandler : public OptionsPageUIHandler, // the apps cookies window. void SetViewContext(const base::ListValue* args); + // Reloads the CookiesTreeModel and passes the nodes to + // 'CookiesView.loadChildren' to update the WebUI. + void ReloadCookies(const base::ListValue* args); + // Return the proper callback string, depending on whether the model is // in regular cookies mode or apps cookies mode. std::string GetCallback(std::string method, CookiesTreeModel* model); |