Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / ash / shelf / shelf.cc
index 51a90d1..0a02248 100644 (file)
 #include "ash/shell_delegate.h"
 #include "ash/shell_window_ids.h"
 #include "ash/wm/window_properties.h"
-#include "grit/ash_resources.h"
-#include "ui/aura/client/activation_client.h"
-#include "ui/aura/root_window.h"
 #include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
 #include "ui/aura/window_observer.h"
-#include "ui/base/resource/resource_bundle.h"
 #include "ui/compositor/layer.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/image/image.h"
@@ -37,6 +34,7 @@
 #include "ui/views/accessible_pane_view.h"
 #include "ui/views/widget/widget.h"
 #include "ui/views/widget/widget_delegate.h"
+#include "ui/wm/public/activation_client.h"
 
 namespace ash {
 
@@ -49,7 +47,7 @@ Shelf::Shelf(ShelfModel* shelf_model,
       alignment_(shelf_widget->GetAlignment()),
       delegate_(shelf_delegate),
       shelf_widget_(shelf_widget) {
-  shelf_view_ = new internal::ShelfView(
+  shelf_view_ = new ShelfView(
       shelf_model, delegate_, shelf_widget_->shelf_layout_manager());
   shelf_view_->Init();
   shelf_widget_->GetContentsView()->AddChildView(shelf_view_);
@@ -63,15 +61,14 @@ Shelf::~Shelf() {
 
 // static
 Shelf* Shelf::ForPrimaryDisplay() {
-  ShelfWidget* shelf_widget = internal::RootWindowController::ForShelf(
-      Shell::GetPrimaryRootWindow())->shelf();
+  ShelfWidget* shelf_widget =
+      RootWindowController::ForShelf(Shell::GetPrimaryRootWindow())->shelf();
   return shelf_widget ? shelf_widget->shelf() : NULL;
 }
 
 // static
 Shelf* Shelf::ForWindow(aura::Window* window) {
-  ShelfWidget* shelf_widget =
-      internal::RootWindowController::ForShelf(window)->shelf();
+  ShelfWidget* shelf_widget = RootWindowController::ForShelf(window)->shelf();
   return shelf_widget ? shelf_widget->shelf() : NULL;
 }
 
@@ -81,8 +78,9 @@ void Shelf::SetAlignment(ShelfAlignment alignment) {
   // ShelfLayoutManager will resize the shelf.
 }
 
-gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow(aura::Window* window) {
-  LauncherID id = GetLauncherIDForWindow(window);
+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);
@@ -94,7 +92,7 @@ gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow(aura::Window* window) {
 
 void Shelf::UpdateIconPositionForWindow(aura::Window* window) {
   shelf_view_->UpdatePanelIconPosition(
-      GetLauncherIDForWindow(window),
+      GetShelfIDForWindow(window),
       ScreenUtil::ConvertRectFromScreen(
           shelf_widget()->GetNativeView(),
           window->GetBoundsInScreen()).CenterPoint());
@@ -105,10 +103,9 @@ void Shelf::ActivateShelfItem(int index) {
   // next item if the current one is already active.
   ui::KeyEvent event(ui::ET_KEY_RELEASED,
                      ui::VKEY_UNKNOWN,  // The actual key gets ignored.
-                     ui::EF_NONE,
-                     false);
+                     ui::EF_NONE);
 
-  const LauncherItem& item = shelf_view_->model()->items()[index];
+  const ShelfItem& item = shelf_view_->model()->items()[index];
   ShelfItemDelegate* item_delegate =
       Shell::GetInstance()->shelf_item_delegate_manager()->GetShelfItemDelegate(
           item.id);
@@ -156,7 +153,7 @@ views::View* Shelf::GetAppListButtonView() const {
 
 void Shelf::LaunchAppIndexAt(int item_index) {
   ShelfModel* shelf_model = shelf_view_->model();
-  const LauncherItems& items = shelf_model->items();
+  const ShelfItems& items = shelf_model->items();
   int item_count = shelf_model->item_count();
   int indexes_left = item_index >= 0 ? item_index : item_count;
   int found_index = -1;