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

Unified Diff: athena/content/web_activity.cc

Issue 498023003: Delete activity upon window deletion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/athena.gyp ('k') | athena/extensions/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/content/web_activity.cc
diff --git a/athena/content/web_activity.cc b/athena/content/web_activity.cc
index e4eb00688ee4799156005b68775e6eb83b5bb34f..95ddd35b862b73df8c402a4e2636263b6992e640 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -27,6 +27,7 @@ class WebActivityController : public AcceleratorHandler {
CMD_FORWARD,
CMD_RELOAD,
CMD_RELOAD_IGNORE_CACHE,
+ CMD_CLOSE,
};
explicit WebActivityController(views::WebView* web_view)
@@ -48,6 +49,7 @@ class WebActivityController : public AcceleratorHandler {
AF_NONE},
{TRIGGER_ON_PRESS, ui::VKEY_BROWSER_BACK, ui::EF_NONE, CMD_BACK,
AF_NONE},
+ {TRIGGER_ON_PRESS, ui::VKEY_W, ui::EF_CONTROL_DOWN, CMD_CLOSE, AF_NONE},
};
accelerator_manager_->RegisterAccelerators(
accelerator_data, arraysize(accelerator_data), this);
@@ -85,11 +87,15 @@ class WebActivityController : public AcceleratorHandler {
virtual bool IsCommandEnabled(int command_id) const OVERRIDE {
switch (command_id) {
case CMD_RELOAD:
+ case CMD_RELOAD_IGNORE_CACHE:
return true;
case CMD_BACK:
return web_view_->GetWebContents()->GetController().CanGoBack();
case CMD_FORWARD:
return web_view_->GetWebContents()->GetController().CanGoForward();
+ case CMD_CLOSE:
+ // TODO(oshima): check onbeforeunload handler.
+ return true;
}
return false;
}
@@ -109,6 +115,9 @@ class WebActivityController : public AcceleratorHandler {
case CMD_FORWARD:
web_view_->GetWebContents()->GetController().GoForward();
return true;
+ case CMD_CLOSE:
+ web_view_->GetWidget()->Close();
+ return true;
}
return false;
}
« no previous file with comments | « athena/athena.gyp ('k') | athena/extensions/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698