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

Unified Diff: ash/shelf/shelf.cc

Issue 1996563002: Add ImeMenuTray element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change SetWindowState() with SetImeWindow(). Created 4 years, 6 months 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: ash/shelf/shelf.cc
diff --git a/ash/shelf/shelf.cc b/ash/shelf/shelf.cc
index 358badd6739f5d43e4b8d9321b7ae54e85d3975d..f3c1b36a950e2d2fc8917cbd5ea23d0d0ca677ff 100644
--- a/ash/shelf/shelf.cc
+++ b/ash/shelf/shelf.cc
@@ -36,6 +36,10 @@
#include "ui/views/widget/widget_delegate.h"
#include "ui/wm/public/activation_client.h"
+#if defined(OS_CHROMEOS)
+#include "ash/system/chromeos/ime_menu/ime_menu_tray.h"
+#endif // defined(OS_CHROMEOS)
+
namespace ash {
const char Shelf::kNativeViewName[] = "ShelfView";
@@ -115,12 +119,24 @@ ShelfVisibilityState Shelf::GetVisibilityState() const {
gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow(
const aura::Window* window) {
ShelfID id = GetShelfIDForWindow(window);
- gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id));
- gfx::Point screen_origin;
- views::View::ConvertPointToScreen(shelf_view_, &screen_origin);
- return gfx::Rect(screen_origin.x() + bounds.x(),
- screen_origin.y() + bounds.y(), bounds.width(),
- bounds.height());
+ gfx::Rect bounds;
+ gfx::Vector2d offset;
+#if defined(OS_CHROMEOS)
+ if (window->GetProperty(kShelfItemOnTrayForImeMenu)) {
+ // For opt-in IME menu, the item icon lays on the status tray.
+ bounds = shelf_widget_->status_area_widget()->ime_menu_tray()->bounds();
+ gfx::Rect status_area_bounds =
+ shelf_widget_->status_area_widget()->GetWindowBoundsInScreen();
+ offset = status_area_bounds.OffsetFromOrigin();
+ }
+#endif // defined(OS_CHROMEOS)
+ if (!window->GetProperty(kShelfItemOnTrayForImeMenu)) {
+ bounds = (shelf_view_->GetIdealBoundsOfItemIcon(id));
+ gfx::Point screen_origin;
+ views::View::ConvertPointToScreen(shelf_view_, &screen_origin);
+ offset = screen_origin.OffsetFromOrigin();
+ }
+ return bounds + offset;
}
void Shelf::UpdateIconPositionForWindow(aura::Window* window) {

Powered by Google App Engine
This is Rietveld 408576698