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

Side by Side Diff: webkit/glue/webframe_impl.cc

Issue 254002: Fix cmd-up/cmd-down. (Closed)
Patch Set: Fix typo found by suzhe Created 11 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 #endif 114 #endif
115 #include "RenderView.h" 115 #include "RenderView.h"
116 #include "RenderWidget.h" 116 #include "RenderWidget.h"
117 #include "ReplaceSelectionCommand.h" 117 #include "ReplaceSelectionCommand.h"
118 #include "ResourceHandle.h" 118 #include "ResourceHandle.h"
119 #include "ResourceRequest.h" 119 #include "ResourceRequest.h"
120 #include "ScriptController.h" 120 #include "ScriptController.h"
121 #include "ScriptSourceCode.h" 121 #include "ScriptSourceCode.h"
122 #include "ScriptValue.h" 122 #include "ScriptValue.h"
123 #include "ScrollbarTheme.h" 123 #include "ScrollbarTheme.h"
124 #include "ScrollTypes.h"
124 #include "SelectionController.h" 125 #include "SelectionController.h"
125 #include "Settings.h" 126 #include "Settings.h"
126 #include "SkiaUtils.h" 127 #include "SkiaUtils.h"
127 #include "SubstituteData.h" 128 #include "SubstituteData.h"
128 #include "TextIterator.h" 129 #include "TextIterator.h"
129 #include "TextAffinity.h" 130 #include "TextAffinity.h"
130 #include "XPathResult.h" 131 #include "XPathResult.h"
131 132
132 MSVC_POP_WARNING(); 133 MSVC_POP_WARNING();
133 134
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 frame()->editor()->showSpellingGuessPanel(); 1005 frame()->editor()->showSpellingGuessPanel();
1005 } else { 1006 } else {
1006 rv = frame()->editor()->command(AtomicString(command.c_str())).execute(); 1007 rv = frame()->editor()->command(AtomicString(command.c_str())).execute();
1007 } 1008 }
1008 return rv; 1009 return rv;
1009 } 1010 }
1010 1011
1011 bool WebFrameImpl::executeCommand(const WebString& name, 1012 bool WebFrameImpl::executeCommand(const WebString& name,
1012 const WebString& value) { 1013 const WebString& value) {
1013 ASSERT(frame()); 1014 ASSERT(frame());
1014 return frame()->editor()->command(webkit_glue::WebStringToString(name)). 1015 WebCore::String web_name = webkit_glue::WebStringToString(name);
1015 execute(webkit_glue::WebStringToString(value)); 1016
1017 // moveToBeginningOfDocument and moveToEndfDocument are only handled by WebKit
1018 // for editable nodes.
jeremy 2009/09/29 18:12:56 hbono had quite alot to say about this, could you
Nico 2009/09/30 03:51:35 Not sure what you're after…he suggested that we sh
1019 if (!frame()->editor()->canEdit() &&
1020 web_name == "moveToBeginningOfDocument") {
1021 return GetWebViewImpl()->PropagateScroll(WebCore::ScrollUp,
1022 WebCore::ScrollByDocument);
1023 } else if (!frame()->editor()->canEdit() &&
1024 web_name == "moveToEndOfDocument") {
1025 return GetWebViewImpl()->PropagateScroll(WebCore::ScrollDown,
1026 WebCore::ScrollByDocument);
1027 } else {
1028 return frame()->editor()->command(web_name).
1029 execute(webkit_glue::WebStringToString(value));
1030 }
1016 } 1031 }
1017 1032
1018 bool WebFrameImpl::isCommandEnabled(const WebString& name) const { 1033 bool WebFrameImpl::isCommandEnabled(const WebString& name) const {
1019 ASSERT(frame()); 1034 ASSERT(frame());
1020 return frame()->editor()->command(webkit_glue::WebStringToString(name)). 1035 return frame()->editor()->command(webkit_glue::WebStringToString(name)).
1021 isEnabled(); 1036 isEnabled();
1022 } 1037 }
1023 1038
1024 void WebFrameImpl::enableContinuousSpellChecking(bool enable) { 1039 void WebFrameImpl::enableContinuousSpellChecking(bool enable) {
1025 if (enable == isContinuousSpellCheckingEnabled()) 1040 if (enable == isContinuousSpellCheckingEnabled())
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1914
1900 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); 1915 SecurityOrigin* security_origin = frame_->document()->securityOrigin();
1901 1916
1902 if (!frame_->loader()->isScheduledLocationChangePending()) { 1917 if (!frame_->loader()->isScheduledLocationChangePending()) {
1903 frame_->loader()->stopAllLoaders(); 1918 frame_->loader()->stopAllLoaders();
1904 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); 1919 frame_->loader()->begin(frame_->loader()->url(), true, security_origin);
1905 frame_->loader()->write(script_result); 1920 frame_->loader()->write(script_result);
1906 frame_->loader()->end(); 1921 frame_->loader()->end();
1907 } 1922 }
1908 } 1923 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698