OLD | NEW |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 #include "Frame.h" | 87 #include "Frame.h" |
88 #include "FrameChromium.h" | 88 #include "FrameChromium.h" |
89 #include "FrameLoader.h" | 89 #include "FrameLoader.h" |
90 #include "FrameLoadRequest.h" | 90 #include "FrameLoadRequest.h" |
91 #include "FrameTree.h" | 91 #include "FrameTree.h" |
92 #include "FrameView.h" | 92 #include "FrameView.h" |
93 #include "GraphicsContext.h" | 93 #include "GraphicsContext.h" |
94 #include "HTMLHeadElement.h" | 94 #include "HTMLHeadElement.h" |
95 #include "HTMLLinkElement.h" | 95 #include "HTMLLinkElement.h" |
96 #include "HistoryItem.h" | 96 #include "HistoryItem.h" |
| 97 #include "InspectorController.h" |
97 #include "markup.h" | 98 #include "markup.h" |
98 #include "Page.h" | 99 #include "Page.h" |
99 #include "PlatformContextSkia.h" | 100 #include "PlatformContextSkia.h" |
100 #include "RenderFrame.h" | 101 #include "RenderFrame.h" |
101 #if defined(OS_WIN) | 102 #if defined(OS_WIN) |
102 #include "RenderThemeChromiumWin.h" | 103 #include "RenderThemeChromiumWin.h" |
103 #endif | 104 #endif |
104 #include "RenderWidget.h" | 105 #include "RenderWidget.h" |
105 #include "ReplaceSelectionCommand.h" | 106 #include "ReplaceSelectionCommand.h" |
106 #include "ResourceHandle.h" | 107 #include "ResourceHandle.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 int WebFrameImpl::live_object_count_ = 0; | 283 int WebFrameImpl::live_object_count_ = 0; |
283 | 284 |
284 WebFrameImpl::WebFrameImpl() | 285 WebFrameImpl::WebFrameImpl() |
285 // Don't complain about using "this" in initializer list. | 286 // Don't complain about using "this" in initializer list. |
286 MSVC_PUSH_DISABLE_WARNING(4355) | 287 MSVC_PUSH_DISABLE_WARNING(4355) |
287 : frame_loader_client_(this), | 288 : frame_loader_client_(this), |
288 scope_matches_factory_(this), | 289 scope_matches_factory_(this), |
289 MSVC_POP_WARNING() | 290 MSVC_POP_WARNING() |
290 currently_loading_request_(NULL), | 291 currently_loading_request_(NULL), |
291 plugin_delegate_(NULL), | 292 plugin_delegate_(NULL), |
292 inspected_node_(NULL), | |
293 active_match_frame_(NULL), | 293 active_match_frame_(NULL), |
294 active_match_index_(-1), | 294 active_match_index_(-1), |
295 locating_active_rect_(false), | 295 locating_active_rect_(false), |
296 resume_scoping_from_range_(NULL), | 296 resume_scoping_from_range_(NULL), |
297 last_match_count_(-1), | 297 last_match_count_(-1), |
298 total_matchcount_(-1), | 298 total_matchcount_(-1), |
299 frames_scoping_count_(-1), | 299 frames_scoping_count_(-1), |
300 scoping_complete_(false), | 300 scoping_complete_(false), |
301 next_invalidate_after_(0), | 301 next_invalidate_after_(0), |
302 printing_(false) { | 302 printing_(false) { |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 // 1125, 1688, 2K, 3K). | 947 // 1125, 1688, 2K, 3K). |
948 static const int start_slowing_down_after = 500; | 948 static const int start_slowing_down_after = 500; |
949 static const int slowdown = 750; | 949 static const int slowdown = 750; |
950 int i = (last_match_count_ / start_slowing_down_after); | 950 int i = (last_match_count_ / start_slowing_down_after); |
951 next_invalidate_after_ += i * slowdown; | 951 next_invalidate_after_ += i * slowdown; |
952 | 952 |
953 InvalidateArea(INVALIDATE_SCROLLBAR); | 953 InvalidateArea(INVALIDATE_SCROLLBAR); |
954 } | 954 } |
955 } | 955 } |
956 | 956 |
957 void WebFrameImpl::selectNodeFromInspector(WebCore::Node* node) { | |
958 inspected_node_ = node; | |
959 } | |
960 | |
961 void WebFrameImpl::AddMarker(WebCore::Range* range) { | 957 void WebFrameImpl::AddMarker(WebCore::Range* range) { |
962 // Use a TextIterator to visit the potentially multiple nodes the range | 958 // Use a TextIterator to visit the potentially multiple nodes the range |
963 // covers. | 959 // covers. |
964 TextIterator markedText(range); | 960 TextIterator markedText(range); |
965 for (; !markedText.atEnd(); markedText.advance()) { | 961 for (; !markedText.atEnd(); markedText.advance()) { |
966 RefPtr<Range> textPiece = markedText.range(); | 962 RefPtr<Range> textPiece = markedText.range(); |
967 int exception = 0; | 963 int exception = 0; |
968 | 964 |
969 WebCore::DocumentMarker marker = { | 965 WebCore::DocumentMarker marker = { |
970 WebCore::DocumentMarker::TextMatch, | 966 WebCore::DocumentMarker::TextMatch, |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext(); | 1446 CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext(); |
1451 GraphicsContext gc(context); | 1447 GraphicsContext gc(context); |
1452 #else | 1448 #else |
1453 PlatformContextSkia context(canvas); | 1449 PlatformContextSkia context(canvas); |
1454 | 1450 |
1455 // PlatformGraphicsContext is actually a pointer to PlatformContextSkia | 1451 // PlatformGraphicsContext is actually a pointer to PlatformContextSkia |
1456 GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); | 1452 GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); |
1457 #endif | 1453 #endif |
1458 if (frame_->document() && frameview()) { | 1454 if (frame_->document() && frameview()) { |
1459 frameview()->paint(&gc, dirty_rect); | 1455 frameview()->paint(&gc, dirty_rect); |
| 1456 frame_->page()->inspectorController()->drawNodeHighlight(gc); |
1460 } else { | 1457 } else { |
1461 gc.fillRect(dirty_rect, Color::white); | 1458 gc.fillRect(dirty_rect, Color::white); |
1462 } | 1459 } |
1463 } | 1460 } |
1464 } | 1461 } |
1465 | 1462 |
1466 bool WebFrameImpl::CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image, | 1463 bool WebFrameImpl::CaptureImage(scoped_ptr<skia::BitmapPlatformDevice>* image, |
1467 bool scroll_to_zero) { | 1464 bool scroll_to_zero) { |
1468 if (!image) { | 1465 if (!image) { |
1469 NOTREACHED(); | 1466 NOTREACHED(); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 return password_listeners_.get(input_element); | 1841 return password_listeners_.get(input_element); |
1845 } | 1842 } |
1846 | 1843 |
1847 void WebFrameImpl::ClearPasswordListeners() { | 1844 void WebFrameImpl::ClearPasswordListeners() { |
1848 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); | 1845 for (PasswordListenerMap::iterator iter = password_listeners_.begin(); |
1849 iter != password_listeners_.end(); ++iter) { | 1846 iter != password_listeners_.end(); ++iter) { |
1850 delete iter->second; | 1847 delete iter->second; |
1851 } | 1848 } |
1852 password_listeners_.clear(); | 1849 password_listeners_.clear(); |
1853 } | 1850 } |
OLD | NEW |