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

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

Issue 323723002: Removing WTL from content runner. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: BrowserAccessibilityTest fix Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/app/content_main_runner.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 (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_manager_win.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/win/scoped_comptr.h" 8 #include "base/win/scoped_comptr.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
11 #include "content/browser/accessibility/browser_accessibility_win.h" 11 #include "content/browser/accessibility/browser_accessibility_win.h"
12 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" 12 #include "content/browser/renderer_host/legacy_render_widget_host_win.h"
13 #include "content/common/accessibility_messages.h" 13 #include "content/common/accessibility_messages.h"
14 #include "ui/base/win/atl_module.h"
14 15
15 namespace content { 16 namespace content {
16 17
17 // static 18 // static
18 BrowserAccessibilityManager* BrowserAccessibilityManager::Create( 19 BrowserAccessibilityManager* BrowserAccessibilityManager::Create(
19 const ui::AXTreeUpdate& initial_tree, 20 const ui::AXTreeUpdate& initial_tree,
20 BrowserAccessibilityDelegate* delegate, 21 BrowserAccessibilityDelegate* delegate,
21 BrowserAccessibilityFactory* factory) { 22 BrowserAccessibilityFactory* factory) {
22 return new BrowserAccessibilityManagerWin( 23 return new BrowserAccessibilityManagerWin(
23 content::LegacyRenderWidgetHostHWND::Create(GetDesktopWindow()).get(), 24 content::LegacyRenderWidgetHostHWND::Create(GetDesktopWindow()).get(),
24 NULL, initial_tree, delegate, factory); 25 NULL, initial_tree, delegate, factory);
25 } 26 }
26 27
27 BrowserAccessibilityManagerWin* 28 BrowserAccessibilityManagerWin*
28 BrowserAccessibilityManager::ToBrowserAccessibilityManagerWin() { 29 BrowserAccessibilityManager::ToBrowserAccessibilityManagerWin() {
29 return static_cast<BrowserAccessibilityManagerWin*>(this); 30 return static_cast<BrowserAccessibilityManagerWin*>(this);
30 } 31 }
31 32
32 BrowserAccessibilityManagerWin::BrowserAccessibilityManagerWin( 33 BrowserAccessibilityManagerWin::BrowserAccessibilityManagerWin(
33 LegacyRenderWidgetHostHWND* accessible_hwnd, 34 LegacyRenderWidgetHostHWND* accessible_hwnd,
34 IAccessible* parent_iaccessible, 35 IAccessible* parent_iaccessible,
35 const ui::AXTreeUpdate& initial_tree, 36 const ui::AXTreeUpdate& initial_tree,
36 BrowserAccessibilityDelegate* delegate, 37 BrowserAccessibilityDelegate* delegate,
37 BrowserAccessibilityFactory* factory) 38 BrowserAccessibilityFactory* factory)
38 : BrowserAccessibilityManager(initial_tree, delegate, factory), 39 : BrowserAccessibilityManager(initial_tree, delegate, factory),
39 parent_hwnd_(accessible_hwnd->GetParent()), 40 parent_hwnd_(accessible_hwnd->GetParent()),
40 parent_iaccessible_(parent_iaccessible), 41 parent_iaccessible_(parent_iaccessible),
41 tracked_scroll_object_(NULL), 42 tracked_scroll_object_(NULL),
42 accessible_hwnd_(accessible_hwnd) { 43 accessible_hwnd_(accessible_hwnd) {
44 ui::win::CreateATLModuleIfNeeded();
43 accessible_hwnd_->set_browser_accessibility_manager(this); 45 accessible_hwnd_->set_browser_accessibility_manager(this);
44 } 46 }
45 47
46 BrowserAccessibilityManagerWin::~BrowserAccessibilityManagerWin() { 48 BrowserAccessibilityManagerWin::~BrowserAccessibilityManagerWin() {
47 if (tracked_scroll_object_) { 49 if (tracked_scroll_object_) {
48 tracked_scroll_object_->Release(); 50 tracked_scroll_object_->Release();
49 tracked_scroll_object_ = NULL; 51 tracked_scroll_object_ = NULL;
50 } 52 }
51 if (accessible_hwnd_) 53 if (accessible_hwnd_)
52 accessible_hwnd_->OnManagerDeleted(); 54 accessible_hwnd_->OnManagerDeleted();
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // |parent_iaccessible_| are no longer valid either, since they were 261 // |parent_iaccessible_| are no longer valid either, since they were
260 // derived from AccessibleHWND. We don't have to restore them to 262 // derived from AccessibleHWND. We don't have to restore them to
261 // previous values, though, because this should only happen 263 // previous values, though, because this should only happen
262 // during the destruct sequence for this window. 264 // during the destruct sequence for this window.
263 accessible_hwnd_ = NULL; 265 accessible_hwnd_ = NULL;
264 parent_hwnd_ = NULL; 266 parent_hwnd_ = NULL;
265 parent_iaccessible_ = NULL; 267 parent_iaccessible_ = NULL;
266 } 268 }
267 269
268 } // namespace content 270 } // namespace content
OLDNEW
« no previous file with comments | « content/app/content_main_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698