OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wm/overview/window_selector_item.h" | 5 #include "ash/wm/overview/window_selector_item.h" |
6 | 6 |
7 #include "ash/screen_util.h" | 7 #include "ash/screen_util.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/overview/scoped_transform_overview_window.h" | 10 #include "ash/wm/overview/scoped_transform_overview_window.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 87 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
88 params.parent = | 88 params.parent = |
89 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer); | 89 Shell::GetContainer(root_window, ash::kShellWindowId_OverlayContainer); |
90 params.accept_events = false; | 90 params.accept_events = false; |
91 params.visible_on_all_workspaces = true; | 91 params.visible_on_all_workspaces = true; |
92 widget->set_focus_on_creation(false); | 92 widget->set_focus_on_creation(false); |
93 widget->Init(params); | 93 widget->Init(params); |
94 views::Label* label = new views::Label; | 94 views::Label* label = new views::Label; |
95 label->SetEnabledColor(kLabelColor); | 95 label->SetEnabledColor(kLabelColor); |
96 label->SetBackgroundColor(kLabelBackground); | 96 label->SetBackgroundColor(kLabelBackground); |
97 label->set_shadows(gfx::ShadowValues(1, gfx::ShadowValue( | 97 label->SetShadows(gfx::ShadowValues( |
98 gfx::Point(0, kVerticalShadowOffset), kShadowBlur, kLabelShadow))); | 98 1, |
| 99 gfx::ShadowValue( |
| 100 gfx::Point(0, kVerticalShadowOffset), kShadowBlur, kLabelShadow))); |
99 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 101 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
100 label->SetFontList(bundle.GetFontList(ui::ResourceBundle::BoldFont)); | 102 label->SetFontList(bundle.GetFontList(ui::ResourceBundle::BoldFont)); |
101 label->SetText(title); | 103 label->SetText(title); |
102 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, | 104 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, |
103 0, | 105 0, |
104 kVerticalLabelPadding, | 106 kVerticalLabelPadding, |
105 0); | 107 0); |
106 label->SetLayoutManager(layout); | 108 label->SetLayoutManager(layout); |
107 widget->SetContentsView(label); | 109 widget->SetContentsView(label); |
108 widget->Show(); | 110 widget->Show(); |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 322 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
321 params.parent = | 323 params.parent = |
322 Shell::GetContainer(root_window_, ash::kShellWindowId_OverlayContainer); | 324 Shell::GetContainer(root_window_, ash::kShellWindowId_OverlayContainer); |
323 params.accept_events = false; | 325 params.accept_events = false; |
324 params.visible_on_all_workspaces = true; | 326 params.visible_on_all_workspaces = true; |
325 window_label_->set_focus_on_creation(false); | 327 window_label_->set_focus_on_creation(false); |
326 window_label_->Init(params); | 328 window_label_->Init(params); |
327 window_label_view_ = new views::Label; | 329 window_label_view_ = new views::Label; |
328 window_label_view_->SetEnabledColor(kLabelColor); | 330 window_label_view_->SetEnabledColor(kLabelColor); |
329 window_label_view_->SetBackgroundColor(kLabelBackground); | 331 window_label_view_->SetBackgroundColor(kLabelBackground); |
330 window_label_view_->set_shadows(gfx::ShadowValues(1, gfx::ShadowValue( | 332 window_label_view_->SetShadows(gfx::ShadowValues( |
331 gfx::Point(0, kVerticalShadowOffset), kShadowBlur, kLabelShadow))); | 333 1, |
| 334 gfx::ShadowValue( |
| 335 gfx::Point(0, kVerticalShadowOffset), kShadowBlur, kLabelShadow))); |
332 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 336 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
333 window_label_view_->SetFontList( | 337 window_label_view_->SetFontList( |
334 bundle.GetFontList(ui::ResourceBundle::BoldFont)); | 338 bundle.GetFontList(ui::ResourceBundle::BoldFont)); |
335 window_label_view_->SetText(title); | 339 window_label_view_->SetText(title); |
336 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, | 340 views::BoxLayout* layout = new views::BoxLayout(views::BoxLayout::kVertical, |
337 0, | 341 0, |
338 kVerticalLabelPadding, | 342 kVerticalLabelPadding, |
339 0); | 343 0); |
340 window_label_view_->SetLayoutManager(layout); | 344 window_label_view_->SetLayoutManager(layout); |
341 window_label_->SetContentsView(window_label_view_); | 345 window_label_->SetContentsView(window_label_view_); |
342 window_label_->Show(); | 346 window_label_->Show(); |
343 } | 347 } |
344 | 348 |
345 } // namespace ash | 349 } // namespace ash |
OLD | NEW |