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

Side by Side Diff: pdf/out_of_process_instance.cc

Issue 2700613003: Enable find-in-page across GuestViews. (Closed)
Patch Set: Small fix. Created 3 years, 8 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 | « extensions/browser/guest_view/web_view/web_view_guest.cc ('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 // 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 #include "pdf/out_of_process_instance.h" 5 #include "pdf/out_of_process_instance.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> // for min/max() 10 #include <algorithm> // for min/max()
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 // Check if the plugin is full frame. This is passed in from JS. 342 // Check if the plugin is full frame. This is passed in from JS.
343 for (uint32_t i = 0; i < argc; ++i) { 343 for (uint32_t i = 0; i < argc; ++i) {
344 if (strcmp(argn[i], "full-frame") == 0) { 344 if (strcmp(argn[i], "full-frame") == 0) {
345 full_ = true; 345 full_ = true;
346 break; 346 break;
347 } 347 }
348 } 348 }
349 349
350 // Only allow the plugin to handle find requests if it is full frame. 350 // Allow the plugin to handle find requests.
351 if (full_) 351 SetPluginToHandleFindRequests();
352 SetPluginToHandleFindRequests();
353 352
354 text_input_ = base::MakeUnique<pp::TextInput_Dev>(this); 353 text_input_ = base::MakeUnique<pp::TextInput_Dev>(this);
355 354
356 const char* stream_url = nullptr; 355 const char* stream_url = nullptr;
357 const char* original_url = nullptr; 356 const char* original_url = nullptr;
358 const char* top_level_url = nullptr; 357 const char* top_level_url = nullptr;
359 const char* headers = nullptr; 358 const char* headers = nullptr;
360 for (uint32_t i = 0; i < argc; ++i) { 359 for (uint32_t i = 0; i < argc; ++i) {
361 bool success = true; 360 bool success = true;
362 if (strcmp(argn[i], "src") == 0) 361 if (strcmp(argn[i], "src") == 0)
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1654 const pp::FloatPoint& scroll_offset) { 1653 const pp::FloatPoint& scroll_offset) {
1655 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width(); 1654 float max_x = document_size_.width() * zoom_ - plugin_dip_size_.width();
1656 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f); 1655 float x = std::max(std::min(scroll_offset.x(), max_x), 0.0f);
1657 float min_y = -top_toolbar_height_; 1656 float min_y = -top_toolbar_height_;
1658 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height(); 1657 float max_y = document_size_.height() * zoom_ - plugin_dip_size_.height();
1659 float y = std::max(std::min(scroll_offset.y(), max_y), min_y); 1658 float y = std::max(std::min(scroll_offset.y(), max_y), min_y);
1660 return pp::FloatPoint(x, y); 1659 return pp::FloatPoint(x, y);
1661 } 1660 }
1662 1661
1663 } // namespace chrome_pdf 1662 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698