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/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/view_ids.h" | 10 #include "chrome/browser/ui/view_ids.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 // Create widget to hold status area view. | 52 // Create widget to hold status area view. |
53 status_area_widget_ = new views::Widget; | 53 status_area_widget_ = new views::Widget; |
54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
55 gfx::Size ps = status_area_view_->GetPreferredSize(); | 55 gfx::Size ps = status_area_view_->GetPreferredSize(); |
56 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); | 56 params.bounds = gfx::Rect(0, 0, ps.width(), ps.height()); |
57 params.parent = status_window; | 57 params.parent = status_window; |
58 params.transparent = true; | 58 params.transparent = true; |
59 status_area_widget_->Init(params); | 59 status_area_widget_->Init(params); |
60 status_area_widget_->SetContentsView(status_area_view_); | 60 status_area_widget_->SetContentsView(status_area_view_); |
61 status_area_widget_->Show(); | 61 status_area_widget_->Show(); |
62 status_area_widget_->GetNativeView()->set_name("StatusAreaView"); | 62 status_area_widget_->GetNativeView()->SetName("StatusAreaView"); |
63 | 63 |
64 return status_area_widget_; | 64 return status_area_widget_; |
65 } | 65 } |
66 | 66 |
67 // StatusAreaButton::Delegate implementation. | 67 // StatusAreaButton::Delegate implementation. |
68 | 68 |
69 bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand( | 69 bool StatusAreaHostAura::ShouldExecuteStatusAreaCommand( |
70 const views::View* button_view, int command_id) const { | 70 const views::View* button_view, int command_id) const { |
71 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) |
72 return true; | 72 return true; |
(...skipping 29 matching lines...) Expand all Loading... |
102 } | 102 } |
103 | 103 |
104 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { | 104 StatusAreaButton::TextStyle StatusAreaHostAura::GetStatusAreaTextStyle() const { |
105 return StatusAreaButton::WHITE_HALOED; | 105 return StatusAreaButton::WHITE_HALOED; |
106 } | 106 } |
107 | 107 |
108 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { | 108 void StatusAreaHostAura::ButtonVisibilityChanged(views::View* button_view) { |
109 if (status_area_view_) | 109 if (status_area_view_) |
110 status_area_view_->UpdateButtonVisibility(); | 110 status_area_view_->UpdateButtonVisibility(); |
111 } | 111 } |
OLD | NEW |