Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / pdf / instance.cc
index 8ec4a9e..37192ba 100644 (file)
@@ -597,7 +597,8 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
           engine_->SelectAll();
           return true;
       }
-    } else if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) {
+    }
+    if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) {
       switch (keyboard_event.GetKeyCode()) {
         case ui::VKEY_OEM_4:
           // Left bracket.
@@ -779,6 +780,14 @@ void Instance::StopFind() {
 
 void Instance::Zoom(double scale, bool text_only) {
   UserMetricsRecordAction("PDF.ZoomFromBrowser");
+
+  // If the zoom level doesn't change it means that this zoom change might have
+  // been initiated by the plugin. In that case, we don't want to change the
+  // zoom mode to ZOOM_SCALE as it may have been intentionally set to
+  // ZOOM_FIT_TO_PAGE or some other value when the zoom was last changed.
+  if (scale == zoom_)
+    return;
+
   SetZoom(ZOOM_SCALE, scale);
 }
 
@@ -1277,6 +1286,7 @@ void Instance::NotifyNumberOfFindResultsChanged(int total, bool final_result) {
 }
 
 void Instance::NotifySelectedFindResultChanged(int current_find_index) {
+  DCHECK_GE(current_find_index, 0);
   SelectedFindResultChanged(current_find_index);
 }