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

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

Issue 246079: More WebView / WebViewDelegate cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/inspector_client_impl.cc ('k') | webkit/glue/webpreferences.h » ('j') | 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) 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 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1427 active_match_index_ = -1; 1427 active_match_index_ = -1;
1428 } 1428 }
1429 1429
1430 void WebFrameImpl::increaseMatchCount(int count, int request_id) { 1430 void WebFrameImpl::increaseMatchCount(int count, int request_id) {
1431 // This function should only be called on the mainframe. 1431 // This function should only be called on the mainframe.
1432 DCHECK(!parent()); 1432 DCHECK(!parent());
1433 1433
1434 total_matchcount_ += count; 1434 total_matchcount_ += count;
1435 1435
1436 // Update the UI with the latest findings. 1436 // Update the UI with the latest findings.
1437 WebViewDelegate* webview_delegate = GetWebViewImpl()->delegate(); 1437 if (client_) {
1438 DCHECK(webview_delegate); 1438 client_->reportFindInPageMatchCount(
1439 if (webview_delegate) 1439 request_id, total_matchcount_, frames_scoping_count_ == 0);
1440 webview_delegate->ReportFindInPageMatchCount(total_matchcount_, request_id, 1440 }
1441 frames_scoping_count_ == 0);
1442 } 1441 }
1443 1442
1444 void WebFrameImpl::ReportFindInPageSelection(const WebRect& selection_rect, 1443 void WebFrameImpl::ReportFindInPageSelection(const WebRect& selection_rect,
1445 int active_match_ordinal, 1444 int active_match_ordinal,
1446 int request_id) { 1445 int request_id) {
1447 // Update the UI with the latest selection rect. 1446 // Update the UI with the latest selection rect.
1448 WebViewDelegate* webview_delegate = GetWebViewImpl()->delegate(); 1447 if (client_) {
1449 DCHECK(webview_delegate); 1448 client_->reportFindInPageSelection(
1450 if (webview_delegate) { 1449 request_id, OrdinalOfFirstMatchForFrame(this) + active_match_ordinal,
1451 webview_delegate->ReportFindInPageSelection(
1452 request_id,
1453 OrdinalOfFirstMatchForFrame(this) + active_match_ordinal,
1454 selection_rect); 1450 selection_rect);
1455 } 1451 }
1456 } 1452 }
1457 1453
1458 void WebFrameImpl::resetMatchCount() { 1454 void WebFrameImpl::resetMatchCount() {
1459 total_matchcount_ = 0; 1455 total_matchcount_ = 0;
1460 frames_scoping_count_ = 0; 1456 frames_scoping_count_ = 0;
1461 } 1457 }
1462 1458
1463 WebURL WebFrameImpl::completeURL(const WebString& url) const { 1459 WebURL WebFrameImpl::completeURL(const WebString& url) const {
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 1900
1905 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); 1901 SecurityOrigin* security_origin = frame_->document()->securityOrigin();
1906 1902
1907 if (!frame_->redirectScheduler()->locationChangePending()) { 1903 if (!frame_->redirectScheduler()->locationChangePending()) {
1908 frame_->loader()->stopAllLoaders(); 1904 frame_->loader()->stopAllLoaders();
1909 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); 1905 frame_->loader()->begin(frame_->loader()->url(), true, security_origin);
1910 frame_->loader()->write(script_result); 1906 frame_->loader()->write(script_result);
1911 frame_->loader()->end(); 1907 frame_->loader()->end();
1912 } 1908 }
1913 } 1909 }
OLDNEW
« no previous file with comments | « webkit/glue/inspector_client_impl.cc ('k') | webkit/glue/webpreferences.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698