| 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/common/system/ime/tray_ime_chromeos.h" | 5 #include "ash/common/system/ime/tray_ime_chromeos.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 144 } |
| 145 | 145 |
| 146 private: | 146 private: |
| 147 // ImeListView: | 147 // ImeListView: |
| 148 void HandleViewClicked(views::View* view) override { | 148 void HandleViewClicked(views::View* view) override { |
| 149 ImeListView::HandleViewClicked(view); | 149 ImeListView::HandleViewClicked(view); |
| 150 if (view == settings_) | 150 if (view == settings_) |
| 151 ShowSettings(); | 151 ShowSettings(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void ResetImeListView() override { |
| 155 ImeListView::ResetImeListView(); |
| 156 settings_button_ = nullptr; |
| 157 } |
| 158 |
| 154 void HandleButtonPressed(views::Button* sender, | 159 void HandleButtonPressed(views::Button* sender, |
| 155 const ui::Event& event) override { | 160 const ui::Event& event) override { |
| 156 ImeListView::HandleButtonPressed(sender, event); | 161 ImeListView::HandleButtonPressed(sender, event); |
| 157 if (sender == settings_button_) | 162 if (sender == settings_button_) |
| 158 ShowSettings(); | 163 ShowSettings(); |
| 159 } | 164 } |
| 160 | 165 |
| 161 void CreateExtraTitleRowButtons() override { | 166 void CreateExtraTitleRowButtons() override { |
| 162 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 167 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 163 // It is possible that the settings button has already been created | |
| 164 // through a previous call to Update(). | |
| 165 if (settings_button_) | |
| 166 return; | |
| 167 | |
| 168 tri_view()->SetContainerVisible(TriView::Container::END, true); | 168 tri_view()->SetContainerVisible(TriView::Container::END, true); |
| 169 settings_button_ = CreateSettingsButton(login_); | 169 settings_button_ = CreateSettingsButton(login_); |
| 170 tri_view()->AddView(TriView::Container::END, settings_button_); | 170 tri_view()->AddView(TriView::Container::END, settings_button_); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 void AppendSettings() { | 174 void AppendSettings() { |
| 175 HoverHighlightView* container = new HoverHighlightView(this); | 175 HoverHighlightView* container = new HoverHighlightView(this); |
| 176 container->AddLabel( | 176 container->AddLabel( |
| 177 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( | 177 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 else | 343 else |
| 344 Update(); | 344 Update(); |
| 345 } | 345 } |
| 346 | 346 |
| 347 bool TrayIME::ShouldDefaultViewBeVisible() { | 347 bool TrayIME::ShouldDefaultViewBeVisible() { |
| 348 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || | 348 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || |
| 349 ShouldShowKeyboardToggle()); | 349 ShouldShowKeyboardToggle()); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace ash | 352 } // namespace ash |
| OLD | NEW |