Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 1278973003: Revert of Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
OLDNEW
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/accessibility/browser_accessibility_win.h" 5 #include "content/browser/accessibility/browser_accessibility_win.h"
6 6
7 #include <UIAutomationClient.h> 7 #include <UIAutomationClient.h>
8 #include <UIAutomationCoreApi.h> 8 #include <UIAutomationCoreApi.h>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 962
963 STDMETHODIMP BrowserAccessibilityWin::get_appName(BSTR* app_name) { 963 STDMETHODIMP BrowserAccessibilityWin::get_appName(BSTR* app_name) {
964 // No need to check |instance_active()| because this interface is 964 // No need to check |instance_active()| because this interface is
965 // global, and doesn't depend on any local state. 965 // global, and doesn't depend on any local state.
966 966
967 if (!app_name) 967 if (!app_name)
968 return E_INVALIDARG; 968 return E_INVALIDARG;
969 969
970 // GetProduct() returns a string like "Chrome/aa.bb.cc.dd", split out 970 // GetProduct() returns a string like "Chrome/aa.bb.cc.dd", split out
971 // the part before the "/". 971 // the part before the "/".
972 std::vector<std::string> product_components = base::SplitString( 972 std::vector<std::string> product_components;
973 GetContentClient()->GetProduct(), "/", 973 base::SplitString(GetContentClient()->GetProduct(), '/', &product_components);
974 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
975 DCHECK_EQ(2U, product_components.size()); 974 DCHECK_EQ(2U, product_components.size());
976 if (product_components.size() != 2) 975 if (product_components.size() != 2)
977 return E_FAIL; 976 return E_FAIL;
978 *app_name = SysAllocString(base::UTF8ToUTF16(product_components[0]).c_str()); 977 *app_name = SysAllocString(base::UTF8ToUTF16(product_components[0]).c_str());
979 DCHECK(*app_name); 978 DCHECK(*app_name);
980 return *app_name ? S_OK : E_FAIL; 979 return *app_name ? S_OK : E_FAIL;
981 } 980 }
982 981
983 STDMETHODIMP BrowserAccessibilityWin::get_appVersion(BSTR* app_version) { 982 STDMETHODIMP BrowserAccessibilityWin::get_appVersion(BSTR* app_version) {
984 // No need to check |instance_active()| because this interface is 983 // No need to check |instance_active()| because this interface is
985 // global, and doesn't depend on any local state. 984 // global, and doesn't depend on any local state.
986 985
987 if (!app_version) 986 if (!app_version)
988 return E_INVALIDARG; 987 return E_INVALIDARG;
989 988
990 // GetProduct() returns a string like "Chrome/aa.bb.cc.dd", split out 989 // GetProduct() returns a string like "Chrome/aa.bb.cc.dd", split out
991 // the part after the "/". 990 // the part after the "/".
992 std::vector<std::string> product_components = base::SplitString( 991 std::vector<std::string> product_components;
993 GetContentClient()->GetProduct(), "/", 992 base::SplitString(GetContentClient()->GetProduct(), '/', &product_components);
994 base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
995 DCHECK_EQ(2U, product_components.size()); 993 DCHECK_EQ(2U, product_components.size());
996 if (product_components.size() != 2) 994 if (product_components.size() != 2)
997 return E_FAIL; 995 return E_FAIL;
998 *app_version = 996 *app_version =
999 SysAllocString(base::UTF8ToUTF16(product_components[1]).c_str()); 997 SysAllocString(base::UTF8ToUTF16(product_components[1]).c_str());
1000 DCHECK(*app_version); 998 DCHECK(*app_version);
1001 return *app_version ? S_OK : E_FAIL; 999 return *app_version ? S_OK : E_FAIL;
1002 } 1000 }
1003 1001
1004 STDMETHODIMP BrowserAccessibilityWin::get_toolkitName(BSTR* toolkit_name) { 1002 STDMETHODIMP BrowserAccessibilityWin::get_toolkitName(BSTR* toolkit_name) {
(...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after
4379 ia2_role = ia_role; 4377 ia2_role = ia_role;
4380 4378
4381 win_attributes_->ia_role = ia_role; 4379 win_attributes_->ia_role = ia_role;
4382 win_attributes_->ia_state = ia_state; 4380 win_attributes_->ia_state = ia_state;
4383 win_attributes_->role_name = role_name; 4381 win_attributes_->role_name = role_name;
4384 win_attributes_->ia2_role = ia2_role; 4382 win_attributes_->ia2_role = ia2_role;
4385 win_attributes_->ia2_state = ia2_state; 4383 win_attributes_->ia2_state = ia2_state;
4386 } 4384 }
4387 4385
4388 } // namespace content 4386 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/trace_config.cc ('k') | content/browser/accessibility/dump_accessibility_browsertest_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698