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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 284793003: Implement languagechange event, fired when accept languages changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase and add tests Created 6 years, 7 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
« no previous file with comments | « Source/core/page/Page.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize ()) 901 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize ())
902 : root->pixelSnappedBoundingBox(); 902 : root->pixelSnappedBoundingBox();
903 903
904 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox ); 904 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox );
905 boundingBox.scale(pageScaleFactor()); 905 boundingBox.scale(pageScaleFactor());
906 bounds = boundingBox; 906 bounds = boundingBox;
907 } 907 }
908 908
909 void WebViewImpl::acceptLanguagesChanged() 909 void WebViewImpl::acceptLanguagesChanged()
910 { 910 {
911 if (!page())
912 return;
913
914 page()->acceptLanguagesChanged();
911 } 915 }
912 916
913 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) 917 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
914 { 918 {
915 ASSERT((event.type == WebInputEvent::RawKeyDown) 919 ASSERT((event.type == WebInputEvent::RawKeyDown)
916 || (event.type == WebInputEvent::KeyDown) 920 || (event.type == WebInputEvent::KeyDown)
917 || (event.type == WebInputEvent::KeyUp)); 921 || (event.type == WebInputEvent::KeyUp));
918 922
919 // Halt an in-progress fling on a key event. 923 // Halt an in-progress fling on a key event.
920 endActiveFlingAnimation(); 924 endActiveFlingAnimation();
(...skipping 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4083 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4080 4084
4081 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4085 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4082 return false; 4086 return false;
4083 4087
4084 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4088 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4085 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4089 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4086 } 4090 }
4087 4091
4088 } // namespace blink 4092 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/Page.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698