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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 7645041: mac: Makeshift UI for scroll feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 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
Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 682f0c9afede1232503e15064c666072b560966f..73e52d384fa09b589c65fa9153a3f2e71df946d9 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -25,6 +25,7 @@
#include "chrome/browser/spellchecker/spellchecker_platform_engine.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#import "chrome/browser/ui/cocoa/history_overlay_controller.h"
#import "chrome/browser/ui/cocoa/rwhvm_editcommand_helper.h"
#import "chrome/browser/ui/cocoa/view_id_util.h"
#include "chrome/common/render_messages.h"
@@ -1589,6 +1590,13 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
// rubberband or send back an event unhandled.
(isPinnedLeft_ && !isRightScroll) ||
(isPinnedRight_ && isRightScroll))) {
+
+ // Released by the tracking handler once the gesture is complete.
+ HistoryOverlayController* historyOverlay =
+ [[HistoryOverlayController alloc]
+ initForMode:goForward ? kHistoryOverlayModeForward :
+ kHistoryOverlayModeBack];
+
// The way this api works: gestureAmount is between -1 and 1 (float). If
// the user does the gesture for more than about 25% (i.e. < -0.25 or >
// 0.25) and then lets go, it is accepted, we get a NSEventPhaseEnded,
@@ -1603,9 +1611,13 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
NSEventPhase phase,
BOOL isComplete,
BOOL *stop) {
+ if (phase == NSEventPhaseBegan) {
+ [historyOverlay showPanelForWindow:[self window]];
+ return;
+ }
+
// |gestureAmount| obeys -[NSEvent isDirectionInvertedFromDevice]
// automatically.
- // TODO(thakis): UI.
Browser* browser = BrowserList::GetLastActive();
if (phase == NSEventPhaseEnded && browser) {
if (goForward)
@@ -1613,6 +1625,12 @@ void RenderWidgetHostViewMac::SetTextInputActive(bool active) {
else
browser->GoBack(CURRENT_TAB);
}
+
+ [historyOverlay setProgress:gestureAmount];
+ if (isComplete) {
+ [historyOverlay dismiss];
+ [historyOverlay release];
+ }
}];
return YES;
}

Powered by Google App Engine
This is Rietveld 408576698