| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" | 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegat
e.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 75 } |
| 76 | 76 |
| 77 - (void)touchesCancelledWithEvent:(NSEvent*)event { | 77 - (void)touchesCancelledWithEvent:(NSEvent*)event { |
| 78 [historySwiper_ touchesCancelledWithEvent:event]; | 78 [historySwiper_ touchesCancelledWithEvent:event]; |
| 79 } | 79 } |
| 80 | 80 |
| 81 - (void)touchesEndedWithEvent:(NSEvent*)event { | 81 - (void)touchesEndedWithEvent:(NSEvent*)event { |
| 82 [historySwiper_ touchesEndedWithEvent:event]; | 82 [historySwiper_ touchesEndedWithEvent:event]; |
| 83 } | 83 } |
| 84 | 84 |
| 85 - (BOOL)canRubberbandLeft:(NSView*)view { | |
| 86 return [historySwiper_ canRubberbandLeft:view]; | |
| 87 } | |
| 88 | |
| 89 - (BOOL)canRubberbandRight:(NSView*)view { | |
| 90 return [historySwiper_ canRubberbandRight:view]; | |
| 91 } | |
| 92 | |
| 93 // HistorySwiperDelegate methods | 85 // HistorySwiperDelegate methods |
| 94 | 86 |
| 95 - (BOOL)shouldAllowHistorySwiping { | 87 - (BOOL)shouldAllowHistorySwiping { |
| 96 if (!renderWidgetHost_) | 88 if (!renderWidgetHost_) |
| 97 return NO; | 89 return NO; |
| 98 RenderViewHost* renderViewHost = RenderViewHost::From(renderWidgetHost_); | 90 RenderViewHost* renderViewHost = RenderViewHost::From(renderWidgetHost_); |
| 99 if (!renderViewHost) | 91 if (!renderViewHost) |
| 100 return NO; | 92 return NO; |
| 101 content::WebContents* webContents = | 93 content::WebContents* webContents = |
| 102 content::WebContents::FromRenderViewHost(renderViewHost); | 94 content::WebContents::FromRenderViewHost(renderViewHost); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 196 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
| 205 DCHECK(profile); | 197 DCHECK(profile); |
| 206 PrefService* pref = profile->GetPrefs(); | 198 PrefService* pref = profile->GetPrefs(); |
| 207 pref->SetBoolean(prefs::kEnableContinuousSpellcheck, | 199 pref->SetBoolean(prefs::kEnableContinuousSpellcheck, |
| 208 !pref->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 200 !pref->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
| 209 } | 201 } |
| 210 | 202 |
| 211 // END Spellchecking methods | 203 // END Spellchecking methods |
| 212 | 204 |
| 213 @end | 205 @end |
| OLD | NEW |