OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // * views | 84 // * views |
85 #include "base/gfx/gdi_util.h" | 85 #include "base/gfx/gdi_util.h" |
86 #include "base/gfx/native_theme.h" | 86 #include "base/gfx/native_theme.h" |
87 #include "chrome/common/gfx/emf.h" | 87 #include "chrome/common/gfx/emf.h" |
88 #include "skia/ext/vector_canvas.h" | 88 #include "skia/ext/vector_canvas.h" |
89 #include "views/controls/message_box_view.h" | 89 #include "views/controls/message_box_view.h" |
90 #endif | 90 #endif |
91 | 91 |
92 using base::Time; | 92 using base::Time; |
93 using base::TimeDelta; | 93 using base::TimeDelta; |
94 using webkit_glue::WebAccessibility; | |
95 using WebKit::WebConsoleMessage; | 94 using WebKit::WebConsoleMessage; |
96 using WebKit::WebDragData; | 95 using WebKit::WebDragData; |
97 using WebKit::WebRect; | 96 using WebKit::WebRect; |
98 using WebKit::WebScriptSource; | 97 using WebKit::WebScriptSource; |
99 using WebKit::WebWorker; | 98 using WebKit::WebWorker; |
100 using WebKit::WebWorkerClient; | 99 using WebKit::WebWorkerClient; |
101 | 100 |
102 //----------------------------------------------------------------------------- | 101 //----------------------------------------------------------------------------- |
103 | 102 |
104 // define to write the time necessary for thumbnail/DOM text retrieval, | 103 // define to write the time necessary for thumbnail/DOM text retrieval, |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2035 bool errored, | 2034 bool errored, |
2036 const SkBitmap& image) { | 2035 const SkBitmap& image) { |
2037 Send(new ViewHostMsg_DidDownloadImage(routing_id_, id, image_url, errored, | 2036 Send(new ViewHostMsg_DidDownloadImage(routing_id_, id, image_url, errored, |
2038 image)); | 2037 image)); |
2039 } | 2038 } |
2040 | 2039 |
2041 | 2040 |
2042 void RenderView::OnDownloadImage(int id, | 2041 void RenderView::OnDownloadImage(int id, |
2043 const GURL& image_url, | 2042 const GURL& image_url, |
2044 int image_size) { | 2043 int image_size) { |
2045 | |
2046 bool data_image_failed = false; | 2044 bool data_image_failed = false; |
2047 if (image_url.SchemeIs("data")) { | 2045 if (image_url.SchemeIs("data")) { |
2048 SkBitmap data_image = ImageFromDataUrl(image_url); | 2046 SkBitmap data_image = ImageFromDataUrl(image_url); |
2049 data_image_failed = data_image.empty(); | 2047 data_image_failed = data_image.empty(); |
2050 if (!data_image_failed) { | 2048 if (!data_image_failed) { |
2051 Send(new ViewHostMsg_DidDownloadImage(routing_id_, id, image_url, false, | 2049 Send(new ViewHostMsg_DidDownloadImage(routing_id_, id, image_url, false, |
2052 data_image)); | 2050 data_image)); |
2053 } | 2051 } |
2054 } | 2052 } |
2055 | 2053 |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2741 NOTIMPLEMENTED(); | 2739 NOTIMPLEMENTED(); |
2742 #endif | 2740 #endif |
2743 } | 2741 } |
2744 | 2742 |
2745 void RenderView::OnClearAccessibilityInfo(int acc_obj_id, bool clear_all) { | 2743 void RenderView::OnClearAccessibilityInfo(int acc_obj_id, bool clear_all) { |
2746 #if defined(OS_WIN) | 2744 #if defined(OS_WIN) |
2747 if (!web_accessibility_manager_.get()) { | 2745 if (!web_accessibility_manager_.get()) { |
2748 // If accessibility is not activated, ignore clearing message. | 2746 // If accessibility is not activated, ignore clearing message. |
2749 return; | 2747 return; |
2750 } | 2748 } |
| 2749 |
2751 if (!web_accessibility_manager_->ClearAccObjMap(acc_obj_id, clear_all)) | 2750 if (!web_accessibility_manager_->ClearAccObjMap(acc_obj_id, clear_all)) |
2752 return; | 2751 return; |
| 2752 |
2753 #else // defined(OS_WIN) | 2753 #else // defined(OS_WIN) |
2754 // TODO(port): accessibility not yet implemented | 2754 // TODO(port): accessibility not yet implemented |
2755 NOTIMPLEMENTED(); | 2755 NOTIMPLEMENTED(); |
2756 #endif | 2756 #endif |
2757 } | 2757 } |
2758 | 2758 |
2759 void RenderView::OnGetAllSavableResourceLinksForCurrentPage( | 2759 void RenderView::OnGetAllSavableResourceLinksForCurrentPage( |
2760 const GURL& page_url) { | 2760 const GURL& page_url) { |
2761 // Prepare list to storage all savable resource links. | 2761 // Prepare list to storage all savable resource links. |
2762 std::vector<GURL> resources_list; | 2762 std::vector<GURL> resources_list; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3000 } | 3000 } |
3001 } | 3001 } |
3002 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinishDoc", start_to_finish_doc); | 3002 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinishDoc", start_to_finish_doc); |
3003 UMA_HISTOGRAM_TIMES("Renderer.All.FinishDocToFinish", finish_doc_to_finish); | 3003 UMA_HISTOGRAM_TIMES("Renderer.All.FinishDocToFinish", finish_doc_to_finish); |
3004 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinish", start_to_finish); | 3004 UMA_HISTOGRAM_TIMES("Renderer.All.StartToFinish", start_to_finish); |
3005 if (start_to_first_layout.ToInternalValue() >= 0) { | 3005 if (start_to_first_layout.ToInternalValue() >= 0) { |
3006 UMA_HISTOGRAM_TIMES( | 3006 UMA_HISTOGRAM_TIMES( |
3007 "Renderer.All.StartToFirstLayout", start_to_first_layout); | 3007 "Renderer.All.StartToFirstLayout", start_to_first_layout); |
3008 } | 3008 } |
3009 } | 3009 } |
| 3010 |
| 3011 void RenderView::FocusAccessibilityObject( |
| 3012 WebCore::AccessibilityObject* acc_obj) { |
| 3013 #if defined(OS_WIN) |
| 3014 if (!web_accessibility_manager_.get()) { |
| 3015 web_accessibility_manager_.reset( |
| 3016 webkit_glue::WebAccessibilityManager::Create()); |
| 3017 } |
| 3018 |
| 3019 // Retrieve the accessibility object id of the AccessibilityObject. |
| 3020 int acc_obj_id = web_accessibility_manager_->FocusAccObj(acc_obj); |
| 3021 |
| 3022 // If id is valid, alert the browser side that an accessibility focus change |
| 3023 // occurred. |
| 3024 if (acc_obj_id >= 0) |
| 3025 Send(new ViewHostMsg_AccessibilityFocusChange(routing_id_, acc_obj_id)); |
| 3026 |
| 3027 #else // defined(OS_WIN) |
| 3028 // TODO(port): accessibility not yet implemented |
| 3029 NOTIMPLEMENTED(); |
| 3030 #endif |
| 3031 } |
OLD | NEW |