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 "chrome/browser/ui/views/ash/status_area_host_aura.h" | 5 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 10 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 status_area_view_->AddButton(new MultipleWindowIndicatorButton(this), | 98 status_area_view_->AddButton(new MultipleWindowIndicatorButton(this), |
99 StatusAreaView::NO_BORDER); | 99 StatusAreaView::NO_BORDER); |
100 } | 100 } |
101 | 101 |
102 // Create widget to hold status area view. | 102 // Create widget to hold status area view. |
103 status_area_widget_ = new views::Widget; | 103 status_area_widget_ = new views::Widget; |
104 views::Widget::InitParams params( | 104 views::Widget::InitParams params( |
105 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 105 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
106 gfx::Size ps = status_area_view_->GetPreferredSize(); | 106 gfx::Size ps = status_area_view_->GetPreferredSize(); |
107 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); | 107 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); |
| 108 params.delegate = status_area_view_; |
108 params.parent = status_window; | 109 params.parent = status_window; |
109 params.transparent = true; | 110 params.transparent = true; |
110 status_area_widget_->Init(params); | 111 status_area_widget_->Init(params); |
111 status_area_widget_->GetNativeWindow()->SetName("StatusAreaWindow"); | 112 status_area_widget_->GetNativeWindow()->SetName("StatusAreaWindow"); |
112 // Turn off focus on creation, otherwise the status area will request focus | 113 // Turn off focus on creation, otherwise the status area will request focus |
113 // every time it is shown. | 114 // every time it is shown. |
114 status_area_widget_->set_focus_on_creation(false); | 115 status_area_widget_->set_focus_on_creation(false); |
115 status_area_widget_->SetContentsView(status_area_view_); | 116 status_area_widget_->SetContentsView(status_area_view_); |
116 status_area_widget_->Show(); | 117 status_area_widget_->Show(); |
117 status_area_widget_->GetNativeView()->SetName("StatusAreaView"); | 118 status_area_widget_->GetNativeView()->SetName("StatusAreaView"); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 279 } |
279 | 280 |
280 void StatusAreaHostAura::UpdateAppearance() { | 281 void StatusAreaHostAura::UpdateAppearance() { |
281 status_area_view_->UpdateButtonTextStyle(); | 282 status_area_view_->UpdateButtonTextStyle(); |
282 | 283 |
283 gfx::Size offset = IsLoginOrLockScreenDisplayed() ? | 284 gfx::Size offset = IsLoginOrLockScreenDisplayed() ? |
284 GetCompactModeLoginAndLockOffset() : | 285 GetCompactModeLoginAndLockOffset() : |
285 GetCompactModeBrowserOffset(); | 286 GetCompactModeBrowserOffset(); |
286 ash::Shell::GetInstance()->SetCompactStatusAreaOffset(offset); | 287 ash::Shell::GetInstance()->SetCompactStatusAreaOffset(offset); |
287 } | 288 } |
OLD | NEW |