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: content/browser/web_contents/web_contents_android.cc

Issue 1241723002: Revert "Adjust the text size using page scale information" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2403
Patch Set: Created 5 years, 5 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
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/web_contents/web_contents_android.h" 5 #include "content/browser/web_contents/web_contents_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 float size = -1.0; 67 float size = -1.0;
68 int color = 0; 68 int color = 0;
69 int bgcolor = 0; 69 int bgcolor = 0;
70 int text_style = 0; 70 int text_style = 0;
71 if (node->HasFloatAttribute(ui::AX_ATTR_FONT_SIZE)) { 71 if (node->HasFloatAttribute(ui::AX_ATTR_FONT_SIZE)) {
72 color = node->GetIntAttribute(ui::AX_ATTR_COLOR); 72 color = node->GetIntAttribute(ui::AX_ATTR_COLOR);
73 bgcolor = node->GetIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR); 73 bgcolor = node->GetIntAttribute(ui::AX_ATTR_BACKGROUND_COLOR);
74 size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE); 74 size = node->GetFloatAttribute(ui::AX_ATTR_FONT_SIZE);
75 text_style = node->GetIntAttribute(ui::AX_ATTR_TEXT_STYLE); 75 text_style = node->GetIntAttribute(ui::AX_ATTR_TEXT_STYLE);
76 } 76 }
77
77 ScopedJavaLocalRef<jobject> j_node = 78 ScopedJavaLocalRef<jobject> j_node =
78 Java_WebContentsImpl_createAccessibilitySnapshotNode(env, 79 Java_WebContentsImpl_createAccessibilitySnapshotNode(env,
79 scale_factor * location.x(), scale_factor * location.y(), 80 scale_factor * location.x(), scale_factor * location.y(),
80 scale_factor * node->GetScrollX(), scale_factor * node->GetScrollY(), 81 scale_factor * node->GetScrollX(), scale_factor * node->GetScrollY(),
81 scale_factor * location.width(), scale_factor * location.height(), 82 scale_factor * location.width(), scale_factor * location.height(),
82 j_text.obj(), color, bgcolor, size, text_style, j_class.obj()); 83 j_text.obj(), color, bgcolor, size, text_style, j_class.obj());
83 84
84 for(uint32 i = 0; i < node->PlatformChildCount(); i++) { 85 for(uint32 i = 0; i < node->PlatformChildCount(); i++) {
85 BrowserAccessibilityAndroid* child = 86 BrowserAccessibilityAndroid* child =
86 static_cast<BrowserAccessibilityAndroid*>( 87 static_cast<BrowserAccessibilityAndroid*>(
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 ContentViewCoreImpl* contentViewCore = 589 ContentViewCoreImpl* contentViewCore =
589 ContentViewCoreImpl::FromWebContents(web_contents_); 590 ContentViewCoreImpl::FromWebContents(web_contents_);
590 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback = 591 WebContentsImpl::AXTreeSnapshotCallback snapshot_callback =
591 base::Bind(&AXTreeSnapshotCallback, j_callback, 592 base::Bind(&AXTreeSnapshotCallback, j_callback,
592 contentViewCore->GetScaleFactor()); 593 contentViewCore->GetScaleFactor());
593 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot( 594 static_cast<WebContentsImpl*>(web_contents_)->RequestAXTreeSnapshot(
594 snapshot_callback); 595 snapshot_callback);
595 } 596 }
596 597
597 } // namespace content 598 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698