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 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_gtk.h" |
6 | 6 |
7 // If this gets included after the gtk headers, then a bunch of compiler | 7 // If this gets included after the gtk headers, then a bunch of compiler |
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts | 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts |
9 // badly with net::URLRequestStatus::Status. | 9 // badly with net::URLRequestStatus::Status. |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "content/public/common/content_switches.h" | 39 #include "content/public/common/content_switches.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFact
ory.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFact
ory.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFact
ory.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFact
ory.h" |
44 #include "ui/base/gtk/gtk_compat.h" | 44 #include "ui/base/gtk/gtk_compat.h" |
45 #include "ui/base/text/text_elider.h" | 45 #include "ui/base/text/text_elider.h" |
46 #include "ui/base/x/x11_util.h" | 46 #include "ui/base/x/x11_util.h" |
47 #include "ui/gfx/gtk_native_view_id_manager.h" | 47 #include "ui/gfx/gtk_native_view_id_manager.h" |
48 #include "ui/gfx/gtk_preserve_window.h" | 48 #include "ui/gfx/gtk_preserve_window.h" |
49 #include "webkit/glue/webaccessibility.h" | |
50 #include "webkit/glue/webcursor_gtk_data.h" | 49 #include "webkit/glue/webcursor_gtk_data.h" |
51 #include "webkit/plugins/npapi/webplugin.h" | 50 #include "webkit/plugins/npapi/webplugin.h" |
52 | 51 |
53 namespace { | 52 namespace { |
54 | 53 |
55 // Paint rects on Linux are bounded by the maximum size of a shared memory | 54 // Paint rects on Linux are bounded by the maximum size of a shared memory |
56 // region. By default that's 32MB, but many distros increase it significantly | 55 // region. By default that's 32MB, but many distros increase it significantly |
57 // (i.e. to 256MB). | 56 // (i.e. to 256MB). |
58 // | 57 // |
59 // We fetch the maximum value from /proc/sys/kernel/shmmax at runtime and, if | 58 // We fetch the maximum value from /proc/sys/kernel/shmmax at runtime and, if |
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 | 1485 |
1487 host_->AccessibilitySetTextSelection(acc_obj_id, start_offset, end_offset); | 1486 host_->AccessibilitySetTextSelection(acc_obj_id, start_offset, end_offset); |
1488 } | 1487 } |
1489 | 1488 |
1490 void RenderWidgetHostViewGtk::OnAccessibilityNotifications( | 1489 void RenderWidgetHostViewGtk::OnAccessibilityNotifications( |
1491 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 1490 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
1492 if (!browser_accessibility_manager_.get()) { | 1491 if (!browser_accessibility_manager_.get()) { |
1493 GtkWidget* parent = gtk_widget_get_parent(view_.get()); | 1492 GtkWidget* parent = gtk_widget_get_parent(view_.get()); |
1494 browser_accessibility_manager_.reset( | 1493 browser_accessibility_manager_.reset( |
1495 BrowserAccessibilityManager::CreateEmptyDocument( | 1494 BrowserAccessibilityManager::CreateEmptyDocument( |
1496 parent, static_cast<WebAccessibility::State>(0), this)); | 1495 parent, |
| 1496 static_cast<content::AccessibilityNodeData::State>(0), |
| 1497 this)); |
1497 } | 1498 } |
1498 browser_accessibility_manager_->OnAccessibilityNotifications(params); | 1499 browser_accessibility_manager_->OnAccessibilityNotifications(params); |
1499 } | 1500 } |
1500 | 1501 |
1501 AtkObject* RenderWidgetHostViewGtk::GetAccessible() { | 1502 AtkObject* RenderWidgetHostViewGtk::GetAccessible() { |
1502 RenderWidgetHostImpl::From(GetRenderWidgetHost())-> | 1503 RenderWidgetHostImpl::From(GetRenderWidgetHost())-> |
1503 SetAccessibilityMode(AccessibilityModeComplete); | 1504 SetAccessibilityMode(AccessibilityModeComplete); |
1504 | 1505 |
1505 if (!browser_accessibility_manager_.get()) { | 1506 if (!browser_accessibility_manager_.get()) { |
1506 GtkWidget* parent = gtk_widget_get_parent(view_.get()); | 1507 GtkWidget* parent = gtk_widget_get_parent(view_.get()); |
1507 browser_accessibility_manager_.reset( | 1508 browser_accessibility_manager_.reset( |
1508 BrowserAccessibilityManager::CreateEmptyDocument( | 1509 BrowserAccessibilityManager::CreateEmptyDocument( |
1509 parent, static_cast<WebAccessibility::State>(0), this)); | 1510 parent, |
| 1511 static_cast<content::AccessibilityNodeData::State>(0), |
| 1512 this)); |
1510 } | 1513 } |
1511 BrowserAccessibilityGtk* root = | 1514 BrowserAccessibilityGtk* root = |
1512 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); | 1515 browser_accessibility_manager_->GetRoot()->ToBrowserAccessibilityGtk(); |
1513 | 1516 |
1514 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); | 1517 atk_object_set_role(root->GetAtkObject(), ATK_ROLE_HTML_CONTAINER); |
1515 return root->GetAtkObject(); | 1518 return root->GetAtkObject(); |
1516 } | 1519 } |
OLD | NEW |