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 "ui/views/widget/widget.h" | 5 #include "ui/views/widget/widget.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 params.activatable = InitParams::ACTIVATABLE_NO; | 324 params.activatable = InitParams::ACTIVATABLE_NO; |
325 } | 325 } |
326 | 326 |
327 widget_delegate_ = params.delegate ? | 327 widget_delegate_ = params.delegate ? |
328 params.delegate : new DefaultWidgetDelegate(this); | 328 params.delegate : new DefaultWidgetDelegate(this); |
329 widget_delegate_->set_can_activate(can_activate); | 329 widget_delegate_->set_can_activate(can_activate); |
330 | 330 |
331 ownership_ = params.ownership; | 331 ownership_ = params.ownership; |
332 native_widget_ = CreateNativeWidget(params, this)->AsNativeWidgetPrivate(); | 332 native_widget_ = CreateNativeWidget(params, this)->AsNativeWidgetPrivate(); |
333 root_view_.reset(CreateRootView()); | 333 root_view_.reset(CreateRootView()); |
334 // Make root view of widget accessibility focusable as automation can fire | |
335 // focus change event to it. | |
336 root_view_->SetFocusBehavior(View::FocusBehavior::ACCESSIBLE_ONLY); | |
sky
2016/12/01 00:36:59
Again, might this result in trying to focus widget
yawano
2016/12/01 00:47:08
Yes.
| |
334 default_theme_provider_.reset(new ui::DefaultThemeProvider); | 337 default_theme_provider_.reset(new ui::DefaultThemeProvider); |
335 if (params.type == InitParams::TYPE_MENU) { | 338 if (params.type == InitParams::TYPE_MENU) { |
336 is_mouse_button_pressed_ = | 339 is_mouse_button_pressed_ = |
337 internal::NativeWidgetPrivate::IsMouseButtonDown(); | 340 internal::NativeWidgetPrivate::IsMouseButtonDown(); |
338 } | 341 } |
339 native_widget_->InitNativeWidget(params); | 342 native_widget_->InitNativeWidget(params); |
340 if (RequiresNonClientView(params.type)) { | 343 if (RequiresNonClientView(params.type)) { |
341 non_client_view_ = new NonClientView; | 344 non_client_view_ = new NonClientView; |
342 non_client_view_->SetFrameView(CreateNonClientFrameView()); | 345 non_client_view_->SetFrameView(CreateNonClientFrameView()); |
343 // Create the ClientView, add it to the NonClientView and add the | 346 // Create the ClientView, add it to the NonClientView and add the |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1494 | 1497 |
1495 //////////////////////////////////////////////////////////////////////////////// | 1498 //////////////////////////////////////////////////////////////////////////////// |
1496 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1499 // internal::NativeWidgetPrivate, NativeWidget implementation: |
1497 | 1500 |
1498 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1501 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { |
1499 return this; | 1502 return this; |
1500 } | 1503 } |
1501 | 1504 |
1502 } // namespace internal | 1505 } // namespace internal |
1503 } // namespace views | 1506 } // namespace views |
OLD | NEW |