OLD | NEW |
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 #ifndef CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 5 #ifndef CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
6 #define CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 6 #define CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void OnUpdateTopControlsState(content::TopControlsState constraints, | 64 void OnUpdateTopControlsState(content::TopControlsState constraints, |
65 content::TopControlsState current, | 65 content::TopControlsState current, |
66 bool animate); | 66 bool animate); |
67 void OnRetrieveWebappInformation(const GURL& expected_url); | 67 void OnRetrieveWebappInformation(const GURL& expected_url); |
68 void OnRetrieveMetaTagContent(const GURL& expected_url, | 68 void OnRetrieveMetaTagContent(const GURL& expected_url, |
69 const std::string tag_name); | 69 const std::string tag_name); |
70 #endif | 70 #endif |
71 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); | 71 void OnSetClientSidePhishingDetection(bool enable_phishing_detection); |
72 void OnSetWindowFeatures(const blink::WebWindowFeatures& window_features); | 72 void OnSetWindowFeatures(const blink::WebWindowFeatures& window_features); |
73 | 73 |
74 void CapturePageInfoLater(int page_id, | 74 void CapturePageInfoLater(bool preliminary_capture, |
75 bool preliminary_capture, | |
76 base::TimeDelta delay); | 75 base::TimeDelta delay); |
77 | 76 |
78 // Captures the thumbnail and text contents for indexing for the given load | 77 // Captures the thumbnail and text contents for indexing for the given load |
79 // ID. Kicks off analysis of the captured text. | 78 // ID. Kicks off analysis of the captured text. |
80 void CapturePageInfo(int page_id, bool preliminary_capture); | 79 void CapturePageInfo(bool preliminary_capture); |
81 | 80 |
82 // Retrieves the text from the given frame contents, the page text up to the | 81 // Retrieves the text from the given frame contents, the page text up to the |
83 // maximum amount kMaxIndexChars will be placed into the given buffer. | 82 // maximum amount kMaxIndexChars will be placed into the given buffer. |
84 void CaptureText(blink::WebFrame* frame, base::string16* contents); | 83 void CaptureText(blink::WebFrame* frame, base::string16* contents); |
85 | 84 |
86 // Determines if a host is in the strict security host set. | 85 // Determines if a host is in the strict security host set. |
87 bool IsStrictSecurityHost(const std::string& host); | 86 bool IsStrictSecurityHost(const std::string& host); |
88 | 87 |
89 // Checks if a page contains <meta http-equiv="refresh" ...> tag. | 88 // Checks if a page contains <meta http-equiv="refresh" ...> tag. |
90 bool HasRefreshMetaTag(blink::WebFrame* frame); | 89 bool HasRefreshMetaTag(blink::WebFrame* frame); |
91 | 90 |
92 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. | 91 // Save the JavaScript to preload if a ViewMsg_WebUIJavaScript is received. |
93 std::vector<base::string16> webui_javascript_; | 92 std::vector<base::string16> webui_javascript_; |
94 | 93 |
95 // Owned by ChromeContentRendererClient and outlive us. | 94 // Owned by ChromeContentRendererClient and outlive us. |
96 ChromeRenderProcessObserver* chrome_render_process_observer_; | 95 ChromeRenderProcessObserver* chrome_render_process_observer_; |
97 | 96 |
98 // Have the same lifetime as us. | 97 // Have the same lifetime as us. |
99 TranslateHelper* translate_helper_; | 98 TranslateHelper* translate_helper_; |
100 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; | 99 safe_browsing::PhishingClassifierDelegate* phishing_classifier_; |
101 | 100 |
102 // Page_id from the last page we indexed. This prevents us from indexing the | |
103 // same page twice in a row. | |
104 int32 last_indexed_page_id_; | |
105 // The toplevel URL that was last indexed. This is used together with the | |
106 // page id to decide whether to reindex in certain cases like history | |
107 // replacement. | |
108 GURL last_indexed_url_; | |
109 | |
110 // A color page overlay when visually de-emaphasized. | 101 // A color page overlay when visually de-emaphasized. |
111 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; | 102 scoped_ptr<WebViewColorOverlay> dimmed_color_overlay_; |
112 | 103 |
113 // Used to delay calling CapturePageInfo. | 104 // Used to delay calling CapturePageInfo. |
114 base::Timer capture_timer_; | 105 base::Timer capture_timer_; |
115 | 106 |
116 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); | 107 DISALLOW_COPY_AND_ASSIGN(ChromeRenderViewObserver); |
117 }; | 108 }; |
118 | 109 |
119 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ | 110 #endif // CHROME_RENDERER_CHROME_RENDER_VIEW_OBSERVER_H_ |
OLD | NEW |