| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/frame/panel_controller.h" | 5 #include "chrome/browser/chromeos/frame/panel_controller.h" |
| 6 | 6 |
| 7 #if defined(TOUCH_UI) | 7 #if defined(TOUCH_UI) |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
| 10 #endif | 10 #endif |
| 11 | 11 |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/time.h" | 18 #include "base/time.h" |
| 19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
| 20 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
| 21 #include "content/common/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
| 24 #include "grit/theme_resources_standard.h" | 24 #include "grit/theme_resources_standard.h" |
| 25 #include "grit/ui_resources.h" | 25 #include "grit/ui_resources.h" |
| 26 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" | 26 #include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
| 27 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | 27 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
| 28 #include "third_party/skia/include/effects/SkGradientShader.h" | 28 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
| 30 #include "ui/gfx/canvas_skia.h" | 30 #include "ui/gfx/canvas_skia.h" |
| 31 #include "views/controls/button/image_button.h" | 31 #include "views/controls/button/image_button.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 | 389 |
| 390 bool PanelController::PanelClientEvent(GdkEventClient* event) { | 390 bool PanelController::PanelClientEvent(GdkEventClient* event) { |
| 391 #if defined(TOOLKIT_USES_GTK) | 391 #if defined(TOOLKIT_USES_GTK) |
| 392 WmIpc::Message msg; | 392 WmIpc::Message msg; |
| 393 WmIpc::instance()->DecodeMessage(*event, &msg); | 393 WmIpc::instance()->DecodeMessage(*event, &msg); |
| 394 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_PANEL_STATE) { | 394 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_PANEL_STATE) { |
| 395 bool new_state = msg.param(0); | 395 bool new_state = msg.param(0); |
| 396 if (expanded_ != new_state) { | 396 if (expanded_ != new_state) { |
| 397 expanded_ = new_state; | 397 expanded_ = new_state; |
| 398 State state = new_state ? EXPANDED : MINIMIZED; | 398 State state = new_state ? EXPANDED : MINIMIZED; |
| 399 NotificationService::current()->Notify( | 399 content::NotificationService::current()->Notify( |
| 400 chrome::NOTIFICATION_PANEL_STATE_CHANGED, | 400 chrome::NOTIFICATION_PANEL_STATE_CHANGED, |
| 401 content::Source<PanelController>(this), | 401 content::Source<PanelController>(this), |
| 402 content::Details<State>(&state)); | 402 content::Details<State>(&state)); |
| 403 } | 403 } |
| 404 } | 404 } |
| 405 #endif | 405 #endif |
| 406 return true; | 406 return true; |
| 407 } | 407 } |
| 408 | 408 |
| 409 void PanelController::Close() { | 409 void PanelController::Close() { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 views::Button* sender, const views::Event& event) { | 524 views::Button* sender, const views::Event& event) { |
| 525 if (panel_controller_ && sender == close_button_) | 525 if (panel_controller_ && sender == close_button_) |
| 526 panel_controller_->OnCloseButtonPressed(); | 526 panel_controller_->OnCloseButtonPressed(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 PanelController::TitleContentView::~TitleContentView() { | 529 PanelController::TitleContentView::~TitleContentView() { |
| 530 VLOG(1) << "panel: delete " << this; | 530 VLOG(1) << "panel: delete " << this; |
| 531 } | 531 } |
| 532 | 532 |
| 533 } // namespace chromeos | 533 } // namespace chromeos |
| OLD | NEW |