| 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;
|
| }
|
|
|