| 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 "ash/monitor/secondary_monitor_view.h" | 5 #include "ash/monitor/secondary_monitor_view.h" |
| 6 | 6 |
| 7 #include "grit/ash_strings.h" | 7 #include "grit/ash_strings.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 shortcut_text_ = new views::Label( | 48 shortcut_text_ = new views::Label( |
| 49 l10n_util::GetStringUTF16(IDS_ASH_SECONDARY_MONITOR_SHORTCUT)); | 49 l10n_util::GetStringUTF16(IDS_ASH_SECONDARY_MONITOR_SHORTCUT)); |
| 50 shortcut_text_->SetAutoColorReadabilityEnabled(false); | 50 shortcut_text_->SetAutoColorReadabilityEnabled(false); |
| 51 shortcut_text_->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont)); | 51 shortcut_text_->SetFont(rb.GetFont(ui::ResourceBundle::MediumFont)); |
| 52 shortcut_text_->SetHorizontalAlignment(views::Label::ALIGN_CENTER); | 52 shortcut_text_->SetHorizontalAlignment(views::Label::ALIGN_CENTER); |
| 53 shortcut_text_->SetEnabledColor(kTextColor); | 53 shortcut_text_->SetEnabledColor(kTextColor); |
| 54 AddChildView(shortcut_text_); | 54 AddChildView(shortcut_text_); |
| 55 | 55 |
| 56 shortcut_image_ = new views::ImageView(); | 56 shortcut_image_ = new views::ImageView(); |
| 57 shortcut_image_->SetImage(rb.GetBitmapNamed(IDR_AURA_SWITCH_MONITOR)); | 57 shortcut_image_->SetImage(rb.GetImageSkiaNamed(IDR_AURA_SWITCH_MONITOR)); |
| 58 AddChildView(shortcut_image_); | 58 AddChildView(shortcut_image_); |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual void Layout() { | 61 virtual void Layout() { |
| 62 const int kMessagePositionTopMargin = 40; | 62 const int kMessagePositionTopMargin = 40; |
| 63 const int kShortcutPositionBottomMargin = 40; | 63 const int kShortcutPositionBottomMargin = 40; |
| 64 const int kShortcutMargin = 4; // margin between text and image. | 64 const int kShortcutMargin = 4; // margin between text and image. |
| 65 gfx::Rect b = bounds(); | 65 gfx::Rect b = bounds(); |
| 66 | 66 |
| 67 int msg_height = message_->GetHeightForWidth(b.width()); | 67 int msg_height = message_->GetHeightForWidth(b.width()); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 params.delegate = view; | 102 params.delegate = view; |
| 103 params.parent = parent; | 103 params.parent = parent; |
| 104 desktop_widget->Init(params); | 104 desktop_widget->Init(params); |
| 105 desktop_widget->SetContentsView(view); | 105 desktop_widget->SetContentsView(view); |
| 106 desktop_widget->Show(); | 106 desktop_widget->Show(); |
| 107 desktop_widget->GetNativeView()->SetName("SecondaryMonitor"); | 107 desktop_widget->GetNativeView()->SetName("SecondaryMonitor"); |
| 108 return desktop_widget; | 108 return desktop_widget; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace ash | 111 } // namespace ash |
| OLD | NEW |