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

Unified Diff: chrome/browser/ui/panels/panel_host.cc

Issue 10736037: Enable keyboard shortcuts and some menu commands for browserless Panels. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced Created 8 years, 5 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 | « chrome/browser/ui/panels/panel_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_host.cc
diff --git a/chrome/browser/ui/panels/panel_host.cc b/chrome/browser/ui/panels/panel_host.cc
index c8e998c5552d4c9290cec2b51f226da15086da4a..b8e09d994be9805cf283d22d046638ed90e8bc08 100644
--- a/chrome/browser/ui/panels/panel_host.cc
+++ b/chrome/browser/ui/panels/panel_host.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "base/message_loop.h"
+#include "chrome/browser/chrome_page_zoom.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/panels/panel.h"
@@ -19,12 +20,15 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/site_instance.h"
+#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/rect.h"
+using content::UserMetricsAction;
+
PanelHost::PanelHost(Panel* panel, Profile* profile)
: panel_(panel),
profile_(profile),
@@ -96,10 +100,23 @@ bool PanelHost::IsPopupOrPanel(const content::WebContents* source) const {
return true;
}
+void PanelHost::ContentsZoomChange(bool zoom_in) {
+ Zoom(zoom_in ? content::PAGE_ZOOM_IN : content::PAGE_ZOOM_OUT);
+}
+
bool PanelHost::IsApplication() const {
return true;
}
+bool PanelHost::HandleContextMenu(const content::ContextMenuParams& params) {
+ return true; // Disallow context menu.
+}
+
+void PanelHost::HandleKeyboardEvent(
+ const content::NativeWebKeyboardEvent& event) {
+ return panel_->HandleKeyboardEvent(event);
+}
+
void PanelHost::ResizeDueToAutoResize(content::WebContents* web_contents,
const gfx::Size& new_size) {
panel_->OnContentsAutoResized(new_size);
@@ -146,3 +163,22 @@ ExtensionWindowController* PanelHost::GetExtensionWindowController() const {
content::WebContents* PanelHost::GetAssociatedWebContents() const {
return web_contents_.get();
}
+
+void PanelHost::Reload() {
+ content::RecordAction(UserMetricsAction("Reload"));
+ web_contents_->GetController().Reload(true);
+}
+
+void PanelHost::ReloadIgnoringCache() {
+ content::RecordAction(UserMetricsAction("ReloadIgnoringCache"));
+ web_contents_->GetController().ReloadIgnoringCache(true);
+}
+
+void PanelHost::StopLoading() {
+ content::RecordAction(UserMetricsAction("Stop"));
+ web_contents_->Stop();
+}
+
+void PanelHost::Zoom(content::PageZoom zoom) {
+ chrome_page_zoom::Zoom(web_contents_.get(), zoom);
+}
« no previous file with comments | « chrome/browser/ui/panels/panel_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698