diff options
author | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 13:55:01 +0000 |
---|---|---|
committer | mukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-20 13:55:01 +0000 |
commit | 3ef565863859cd8c4f6d73f2a69ce37d1d6eb521 (patch) | |
tree | a9c47bfd18e9613f526be20363828fe15cabdf03 /ash/system/ime | |
parent | c7d6f5870e520da7f7891619549f467cac520b41 (diff) | |
download | chromium_src-3ef565863859cd8c4f6d73f2a69ce37d1d6eb521.zip chromium_src-3ef565863859cd8c4f6d73f2a69ce37d1d6eb521.tar.gz chromium_src-3ef565863859cd8c4f6d73f2a69ce37d1d6eb521.tar.bz2 |
Removes --disable-ime-mode-indicator flag.
BUG=337910
R=nona@chromium.org, komatsu@chromium.org, oshima@chromium.org, stevenjb@chromium.org
TEST=compile succeeds
Review URL: https://codereview.chromium.org/167793002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252229 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/system/ime')
-rw-r--r-- | ash/system/ime/ime_observer.h | 5 | ||||
-rw-r--r-- | ash/system/ime/tray_ime.cc | 57 | ||||
-rw-r--r-- | ash/system/ime/tray_ime.h | 13 |
3 files changed, 5 insertions, 70 deletions
diff --git a/ash/system/ime/ime_observer.h b/ash/system/ime/ime_observer.h index aee74ae..a7f938c 100644 --- a/ash/system/ime/ime_observer.h +++ b/ash/system/ime/ime_observer.h @@ -12,9 +12,8 @@ class IMEObserver { virtual ~IMEObserver() {} // Notify the observer that the IME state has changed, and should be - // refreshed. |show_message| indicates whether the user should be alerted of - // the change. - virtual void OnIMERefresh(bool show_message) = 0; + // refreshed. + virtual void OnIMERefresh() = 0; }; } // namespace ash diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc index beec2f5..a2dafa4 100644 --- a/ash/system/ime/tray_ime.cc +++ b/ash/system/ime/tray_ime.cc @@ -10,7 +10,6 @@ #include "ash/root_window_controller.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" -#include "ash/system/system_notifier.h" #include "ash/system/tray/hover_highlight_view.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_delegate.h" @@ -28,21 +27,10 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/font.h" #include "ui/gfx/image/image.h" -#include "ui/message_center/message_center.h" -#include "ui/message_center/notification.h" -#include "ui/message_center/notification_delegate.h" #include "ui/views/controls/label.h" #include "ui/views/layout/box_layout.h" #include "ui/views/widget/widget.h" -using message_center::Notification; - -namespace { - -const char kIMENotificationId[] = "chrome://settings/ime"; - -} // namespace - namespace ash { namespace internal { namespace tray { @@ -189,16 +177,12 @@ TrayIME::TrayIME(SystemTray* system_tray) : SystemTrayItem(system_tray), tray_label_(NULL), default_(NULL), - detailed_(NULL), - message_shown_(false), - weak_factory_(this) { + detailed_(NULL) { Shell::GetInstance()->system_tray_notifier()->AddIMEObserver(this); } TrayIME::~TrayIME() { Shell::GetInstance()->system_tray_notifier()->RemoveIMEObserver(this); - message_center::MessageCenter::Get()->RemoveNotification( - kIMENotificationId, false /* by_user */); } void TrayIME::UpdateTrayLabel(const IMEInfo& current, size_t count) { @@ -219,40 +203,6 @@ void TrayIME::UpdateTrayLabel(const IMEInfo& current, size_t count) { } } -void TrayIME::UpdateOrCreateNotification() { - message_center::MessageCenter* message_center = - message_center::MessageCenter::Get(); - - if (!message_center->HasNotification(kIMENotificationId) && message_shown_) - return; - - SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); - IMEInfo current; - delegate->GetCurrentIME(¤t); - - ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); - scoped_ptr<Notification> notification(new Notification( - message_center::NOTIFICATION_TYPE_SIMPLE, - kIMENotificationId, - // TODO(zork): Use IDS_ASH_STATUS_TRAY_THIRD_PARTY_IME_TURNED_ON_BUBBLE - // for third party IMEs - l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_IME_TURNED_ON_BUBBLE, - current.medium_name), - base::string16(), // message - bundle.GetImageNamed(IDR_AURA_UBER_TRAY_IME), - base::string16(), // display_source - message_center::NotifierId( - message_center::NotifierId::SYSTEM_COMPONENT, - system_notifier::kNotifierInputMethod), - message_center::RichNotificationData(), - new message_center::HandleNotificationClickedDelegate( - base::Bind(&TrayIME::PopupDetailedView, - weak_factory_.GetWeakPtr(), 0, true)))); - message_center->AddNotification(notification.Pass()); - message_shown_ = true; -} - views::View* TrayIME::CreateTrayView(user::LoginStatus status) { CHECK(tray_label_ == NULL); tray_label_ = new TrayItemView(this); @@ -303,7 +253,7 @@ void TrayIME::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { tray_label_->Layout(); } -void TrayIME::OnIMERefresh(bool show_message) { +void TrayIME::OnIMERefresh() { SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); IMEInfoList list; IMEInfo current; @@ -318,9 +268,6 @@ void TrayIME::OnIMERefresh(bool show_message) { default_->UpdateLabel(current); if (detailed_) detailed_->Update(list, property_list); - - if (list.size() > 1 && show_message) - UpdateOrCreateNotification(); } } // namespace internal diff --git a/ash/system/ime/tray_ime.h b/ash/system/ime/tray_ime.h index bb65e99..06c81a5 100644 --- a/ash/system/ime/tray_ime.h +++ b/ash/system/ime/tray_ime.h @@ -7,7 +7,6 @@ #include "ash/system/ime/ime_observer.h" #include "ash/system/tray/system_tray_item.h" -#include "base/memory/weak_ptr.h" namespace views { class Label; @@ -36,12 +35,6 @@ class TrayIME : public SystemTrayItem, private: void UpdateTrayLabel(const IMEInfo& info, size_t count); - // Update the content of the existing IME notification, or create a new one if - // necessary. IME notification should be created only once in a session, i.e. - // if an IME notification is created and removed already, it doesn't create a - // new one. - void UpdateOrCreateNotification(); - // Overridden from SystemTrayItem. virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; @@ -54,16 +47,12 @@ class TrayIME : public SystemTrayItem, ShelfAlignment alignment) OVERRIDE; // Overridden from IMEObserver. - virtual void OnIMERefresh(bool show_message) OVERRIDE; + virtual void OnIMERefresh() OVERRIDE; TrayItemView* tray_label_; tray::IMEDefaultView* default_; tray::IMEDetailedView* detailed_; - bool message_shown_; - - base::WeakPtrFactory<TrayIME> weak_factory_; - DISALLOW_COPY_AND_ASSIGN(TrayIME); }; |