| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/system/ime_menu/ime_menu_tray.h" | 5 #include "ash/system/ime_menu/ime_menu_tray.h" |
| 6 | 6 |
| 7 #include "ash/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/ash_constants.h" | 8 #include "ash/ash_constants.h" |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/resources/grit/ash_resources.h" | 10 #include "ash/resources/grit/ash_resources.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 public: | 102 public: |
| 103 ImeMenuLabel() { | 103 ImeMenuLabel() { |
| 104 // Sometimes the label will be more than 2 characters, e.g. INTL and EXTD. | 104 // Sometimes the label will be more than 2 characters, e.g. INTL and EXTD. |
| 105 // This border makes sure we only leave room for ~2 and the others are | 105 // This border makes sure we only leave room for ~2 and the others are |
| 106 // truncated. | 106 // truncated. |
| 107 SetBorder(views::CreateEmptyBorder(gfx::Insets(0, 6))); | 107 SetBorder(views::CreateEmptyBorder(gfx::Insets(0, 6))); |
| 108 } | 108 } |
| 109 ~ImeMenuLabel() override {} | 109 ~ImeMenuLabel() override {} |
| 110 | 110 |
| 111 // views:Label: | 111 // views:Label: |
| 112 gfx::Size GetPreferredSize() const override { | 112 gfx::Size CalculatePreferredSize() const override { |
| 113 return gfx::Size(kTrayItemSize, kTrayItemSize); | 113 return gfx::Size(kTrayItemSize, kTrayItemSize); |
| 114 } | 114 } |
| 115 int GetHeightForWidth(int width) const override { return kTrayItemSize; } | 115 int GetHeightForWidth(int width) const override { return kTrayItemSize; } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 DISALLOW_COPY_AND_ASSIGN(ImeMenuLabel); | 118 DISALLOW_COPY_AND_ASSIGN(ImeMenuLabel); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 SystemMenuButton* CreateImeMenuButton(views::ButtonListener* listener, | 121 SystemMenuButton* CreateImeMenuButton(views::ButtonListener* listener, |
| 122 const gfx::VectorIcon& icon, | 122 const gfx::VectorIcon& icon, |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 else | 551 else |
| 552 label_->SetText(current_ime_.short_name); | 552 label_->SetText(current_ime_.short_name); |
| 553 } | 553 } |
| 554 | 554 |
| 555 void ImeMenuTray::DisableVirtualKeyboard() { | 555 void ImeMenuTray::DisableVirtualKeyboard() { |
| 556 Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(false); | 556 Shell::Get()->accessibility_delegate()->SetVirtualKeyboardEnabled(false); |
| 557 force_show_keyboard_ = false; | 557 force_show_keyboard_ = false; |
| 558 } | 558 } |
| 559 | 559 |
| 560 } // namespace ash | 560 } // namespace ash |
| OLD | NEW |