| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ash/system/user/user_view.h" | 5 #include "ash/system/user/user_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 // gets destroyed.. | 426 // gets destroyed.. |
| 427 add_menu_option_.reset(new views::Widget); | 427 add_menu_option_.reset(new views::Widget); |
| 428 views::Widget::InitParams params; | 428 views::Widget::InitParams params; |
| 429 params.type = views::Widget::InitParams::TYPE_TOOLTIP; | 429 params.type = views::Widget::InitParams::TYPE_TOOLTIP; |
| 430 params.keep_on_top = true; | 430 params.keep_on_top = true; |
| 431 params.context = this->GetWidget()->GetNativeWindow(); | 431 params.context = this->GetWidget()->GetNativeWindow(); |
| 432 params.accept_events = true; | 432 params.accept_events = true; |
| 433 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 433 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 434 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 434 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 435 add_menu_option_->Init(params); | 435 add_menu_option_->Init(params); |
| 436 add_menu_option_->SetOpacity(0xFF); | 436 add_menu_option_->SetOpacity(1.f); |
| 437 add_menu_option_->GetNativeWindow()->set_owned_by_parent(false); | 437 add_menu_option_->GetNativeWindow()->set_owned_by_parent(false); |
| 438 SetShadowType(add_menu_option_->GetNativeView(), ::wm::SHADOW_TYPE_NONE); | 438 SetShadowType(add_menu_option_->GetNativeView(), ::wm::SHADOW_TYPE_NONE); |
| 439 | 439 |
| 440 // Position it below our user card. | 440 // Position it below our user card. |
| 441 gfx::Rect bounds = user_card_view_->GetBoundsInScreen(); | 441 gfx::Rect bounds = user_card_view_->GetBoundsInScreen(); |
| 442 bounds.set_y(bounds.y() + bounds.height()); | 442 bounds.set_y(bounds.y() + bounds.height()); |
| 443 add_menu_option_->SetBounds(bounds); | 443 add_menu_option_->SetBounds(bounds); |
| 444 | 444 |
| 445 // Show the content. | 445 // Show the content. |
| 446 add_menu_option_->SetAlwaysOnTop(true); | 446 add_menu_option_->SetAlwaysOnTop(true); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 focus_manager_ = NULL; | 517 focus_manager_ = NULL; |
| 518 if (user_card_view_->GetFocusManager()) | 518 if (user_card_view_->GetFocusManager()) |
| 519 user_card_view_->GetFocusManager()->ClearFocus(); | 519 user_card_view_->GetFocusManager()->ClearFocus(); |
| 520 popup_message_.reset(); | 520 popup_message_.reset(); |
| 521 mouse_watcher_.reset(); | 521 mouse_watcher_.reset(); |
| 522 add_menu_option_.reset(); | 522 add_menu_option_.reset(); |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace tray | 525 } // namespace tray |
| 526 } // namespace ash | 526 } // namespace ash |
| OLD | NEW |