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

Unified Diff: athena/content/web_activity.cc

Issue 527473002: athena: Add an accelerator to abort loading on escape. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | 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 795c8c3f7bc0257ab101cb43b6d6f696a3493b03..a5d591a359814d3e1aad7f509c28da2273dcd9f0 100644
--- a/athena/content/web_activity.cc
+++ b/athena/content/web_activity.cc
@@ -29,6 +29,7 @@ class WebActivityController : public AcceleratorHandler {
CMD_RELOAD,
CMD_RELOAD_IGNORE_CACHE,
CMD_CLOSE,
+ CMD_STOP,
};
explicit WebActivityController(views::WebView* web_view)
@@ -51,6 +52,7 @@ class WebActivityController : public AcceleratorHandler {
{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},
+ {TRIGGER_ON_PRESS, ui::VKEY_ESCAPE, ui::EF_NONE, CMD_STOP, AF_NONE},
};
accelerator_manager_->RegisterAccelerators(
accelerator_data, arraysize(accelerator_data), this);
@@ -97,6 +99,8 @@ class WebActivityController : public AcceleratorHandler {
case CMD_CLOSE:
// TODO(oshima): check onbeforeunload handler.
return true;
+ case CMD_STOP:
+ return web_view_->GetWebContents()->IsLoading();
}
return false;
}
@@ -119,6 +123,9 @@ class WebActivityController : public AcceleratorHandler {
case CMD_CLOSE:
web_view_->GetWidget()->Close();
return true;
+ case CMD_STOP:
+ web_view_->GetWebContents()->Stop();
+ return true;
}
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698