| 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/native_widget_aura.h" | 5 #include "ui/views/widget/native_widget_aura.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "third_party/skia/include/core/SkRegion.h" | 9 #include "third_party/skia/include/core/SkRegion.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 // We don't necessarily have a root window yet. This can happen with | 508 // We don't necessarily have a root window yet. This can happen with |
| 509 // constrained windows. | 509 // constrained windows. |
| 510 if (window_->GetRootWindow()) { | 510 if (window_->GetRootWindow()) { |
| 511 aura::client::GetActivationClient(window_->GetRootWindow())->ActivateWindow( | 511 aura::client::GetActivationClient(window_->GetRootWindow())->ActivateWindow( |
| 512 window_); | 512 window_); |
| 513 } | 513 } |
| 514 if (window_->GetProperty(aura::client::kDrawAttentionKey)) | 514 if (window_->GetProperty(aura::client::kDrawAttentionKey)) |
| 515 window_->SetProperty(aura::client::kDrawAttentionKey, false); | 515 window_->SetProperty(aura::client::kDrawAttentionKey, false); |
| 516 } | 516 } |
| 517 | 517 |
| 518 void NativeWidgetAura::ActivateForUserGesture() { |
| 519 Activate(); |
| 520 } |
| 521 |
| 518 void NativeWidgetAura::Deactivate() { | 522 void NativeWidgetAura::Deactivate() { |
| 519 if (!window_) | 523 if (!window_) |
| 520 return; | 524 return; |
| 521 aura::client::GetActivationClient(window_->GetRootWindow())->DeactivateWindow( | 525 aura::client::GetActivationClient(window_->GetRootWindow())->DeactivateWindow( |
| 522 window_); | 526 window_); |
| 523 } | 527 } |
| 524 | 528 |
| 525 bool NativeWidgetAura::IsActive() const { | 529 bool NativeWidgetAura::IsActive() const { |
| 526 return window_ && wm::IsActiveWindow(window_); | 530 return window_ && wm::IsActiveWindow(window_); |
| 527 } | 531 } |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1209 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1206 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1210 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1207 return gfx::FontList(gfx::Font(caption_font)); | 1211 return gfx::FontList(gfx::Font(caption_font)); |
| 1208 #else | 1212 #else |
| 1209 return gfx::FontList(); | 1213 return gfx::FontList(); |
| 1210 #endif | 1214 #endif |
| 1211 } | 1215 } |
| 1212 | 1216 |
| 1213 } // namespace internal | 1217 } // namespace internal |
| 1214 } // namespace views | 1218 } // namespace views |
| OLD | NEW |