OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/status_area_host_aura.h" | 5 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 8 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
9 #include "chrome/browser/chromeos/status/memory_menu_button.h" | 9 #include "chrome/browser/chromeos/status/memory_menu_button.h" |
10 #include "chrome/browser/chromeos/status/status_area_view.h" | 10 #include "chrome/browser/chromeos/status/status_area_view.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Create widget to hold status area view. | 67 // Create widget to hold status area view. |
68 status_area_widget_ = new views::Widget; | 68 status_area_widget_ = new views::Widget; |
69 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 69 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
70 gfx::Size ps = status_area_view_->GetPreferredSize(); | 70 gfx::Size ps = status_area_view_->GetPreferredSize(); |
71 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); | 71 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); |
72 params.parent = status_window; | 72 params.parent = status_window; |
73 params.transparent = true; | 73 params.transparent = true; |
74 status_area_widget_->Init(params); | 74 status_area_widget_->Init(params); |
75 status_area_widget_->SetContentsView(status_area_view_); | 75 status_area_widget_->SetContentsView(status_area_view_); |
76 status_area_widget_->Show(); | 76 status_area_widget_->Show(); |
77 status_area_widget_->GetNativeView()->set_name("StatusAreaView"); | 77 status_area_widget_->GetNativeView()->SetName("StatusAreaView"); |
78 | 78 |
79 return status_area_widget_; | 79 return status_area_widget_; |
80 } | 80 } |
81 | 81 |
82 // StatusAreaButton::Delegate implementation. | 82 // StatusAreaButton::Delegate implementation. |
83 | 83 |
84 bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand( | 84 bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand( |
85 const views::View* button_view, int command_id) const { | 85 const views::View* button_view, int command_id) const { |
86 #if defined(OS_CHROMEOS) | 86 #if defined(OS_CHROMEOS) |
87 if (chromeos::StatusAreaViewChromeos::IsLoginMode()) { | 87 if (chromeos::StatusAreaViewChromeos::IsLoginMode()) { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { | 140 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { |
141 return StatusAreaButton::WHITE_HALOED; | 141 return StatusAreaButton::WHITE_HALOED; |
142 } | 142 } |
143 | 143 |
144 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { | 144 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { |
145 if (status_area_view_) | 145 if (status_area_view_) |
146 status_area_view_->UpdateButtonVisibility(); | 146 status_area_view_->UpdateButtonVisibility(); |
147 } | 147 } |
OLD | NEW |