Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Unified Diff: chrome/browser/chromeos/login/keyboard_switch_menu.cc

Issue 8513007: [cros] Use LoginDisplayHost::GetNativeWindow() for status area on login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/keyboard_switch_menu.cc
diff --git a/chrome/browser/chromeos/login/keyboard_switch_menu.cc b/chrome/browser/chromeos/login/keyboard_switch_menu.cc
deleted file mode 100644
index c0cce6d2e97019c726ef9f66a8379f3d9062a659..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/keyboard_switch_menu.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/login/keyboard_switch_menu.h"
-
-#include "base/i18n/rtl.h"
-#include "base/utf_string_conversions.h"
-#include "chrome/browser/chromeos/input_method/input_method_manager.h"
-#include "chrome/browser/chromeos/input_method/input_method_util.h"
-#include "chrome/browser/chromeos/status/status_area_view_chromeos.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "views/controls/button/menu_button.h"
-#include "views/widget/widget.h"
-
-namespace chromeos {
-
-KeyboardSwitchMenu::KeyboardSwitchMenu()
- : InputMethodMenu(NULL /* pref_service */,
- StatusAreaViewChromeos::LOGIN_MODE_VIEWS,
- true /* for_out_of_box_experience_dialog */) {
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// InputMethodMenu::InputMethodMenuHost implementation.
-void KeyboardSwitchMenu::UpdateUI(const std::string& input_method_id,
- const string16& name,
- const string16& tooltip,
- size_t num_active_input_methods) {
- // Update all view hierarchies so that the new input method name is shown in
- // the menu button.
- views::Widget::NotifyLocaleChanged();
-}
-
-bool KeyboardSwitchMenu::ShouldSupportConfigUI() {
- return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// views::ViewMenuDelegate implementation.
-void KeyboardSwitchMenu::RunMenu(views::View* source, const gfx::Point& pt) {
- gfx::Point new_pt(pt);
- views::MenuButton* button = static_cast<views::MenuButton*>(source);
- // Keyboard switch menu is aligned on left by default. MenuButton passes
- // in pt the lower left corner for RTL and the lower right corner for
- // non-RTL (with menu_offset applied).
- int reverse_offset = button->width() + button->menu_offset().x() * 2;
- if (base::i18n::IsRTL()) {
- new_pt.set_x(pt.x() + reverse_offset);
- } else {
- new_pt.set_x(pt.x() - reverse_offset);
- }
-
- set_menu_alignment(views::MenuItemView::TOPLEFT);
- InputMethodMenu::RunMenu(source, new_pt);
-}
-
-string16 KeyboardSwitchMenu::GetCurrentKeyboardName() const {
- const int count = GetItemCount();
- for (int i = 0; i < count; ++i) {
- if (IsItemCheckedAt(i))
- return GetLabelAt(i);
- }
- VLOG(1) << "The input method menu is not ready yet. Show the display "
- << "name of the current input method";
- input_method::InputMethodManager* manager =
- input_method::InputMethodManager::GetInstance();
- return UTF8ToUTF16(
- manager->GetInputMethodUtil()->GetInputMethodDisplayNameFromId(
- manager->current_input_method().id()));
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/keyboard_switch_menu.h ('k') | chrome/browser/chromeos/login/network_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698