| 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 #if defined(HAVE_XINPUT2) | 9 #if defined(HAVE_XINPUT2) |
| 10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
| 11 #endif | 11 #endif |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/time.h" | 20 #include "base/time.h" |
| 21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 22 #include "chrome/browser/chromeos/wm_ipc.h" | 22 #include "chrome/browser/chromeos/wm_ipc.h" |
| 23 #include "chrome/common/chrome_notification_types.h" |
| 23 #include "content/common/notification_service.h" | 24 #include "content/common/notification_service.h" |
| 24 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 25 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
| 26 #include "grit/ui_resources.h" | 27 #include "grit/ui_resources.h" |
| 27 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 28 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 28 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | 29 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
| 29 #include "third_party/skia/include/effects/SkGradientShader.h" | 30 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 31 #include "ui/gfx/canvas_skia.h" | 32 #include "ui/gfx/canvas_skia.h" |
| 32 #include "views/controls/button/image_button.h" | 33 #include "views/controls/button/image_button.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 383 |
| 383 bool PanelController::PanelClientEvent(GdkEventClient* event) { | 384 bool PanelController::PanelClientEvent(GdkEventClient* event) { |
| 384 WmIpc::Message msg; | 385 WmIpc::Message msg; |
| 385 WmIpc::instance()->DecodeMessage(*event, &msg); | 386 WmIpc::instance()->DecodeMessage(*event, &msg); |
| 386 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_PANEL_STATE) { | 387 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_PANEL_STATE) { |
| 387 bool new_state = msg.param(0); | 388 bool new_state = msg.param(0); |
| 388 if (expanded_ != new_state) { | 389 if (expanded_ != new_state) { |
| 389 expanded_ = new_state; | 390 expanded_ = new_state; |
| 390 State state = new_state ? EXPANDED : MINIMIZED; | 391 State state = new_state ? EXPANDED : MINIMIZED; |
| 391 NotificationService::current()->Notify( | 392 NotificationService::current()->Notify( |
| 392 NotificationType::PANEL_STATE_CHANGED, | 393 chrome::NOTIFICATION_PANEL_STATE_CHANGED, |
| 393 Source<PanelController>(this), | 394 Source<PanelController>(this), |
| 394 Details<State>(&state)); | 395 Details<State>(&state)); |
| 395 } | 396 } |
| 396 } | 397 } |
| 397 return true; | 398 return true; |
| 398 } | 399 } |
| 399 | 400 |
| 400 void PanelController::Close() { | 401 void PanelController::Close() { |
| 401 if (client_event_handler_id_ > 0) { | 402 if (client_event_handler_id_ > 0) { |
| 402 g_signal_handler_disconnect(panel_, client_event_handler_id_); | 403 g_signal_handler_disconnect(panel_, client_event_handler_id_); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 views::Button* sender, const views::Event& event) { | 512 views::Button* sender, const views::Event& event) { |
| 512 if (panel_controller_ && sender == close_button_) | 513 if (panel_controller_ && sender == close_button_) |
| 513 panel_controller_->OnCloseButtonPressed(); | 514 panel_controller_->OnCloseButtonPressed(); |
| 514 } | 515 } |
| 515 | 516 |
| 516 PanelController::TitleContentView::~TitleContentView() { | 517 PanelController::TitleContentView::~TitleContentView() { |
| 517 VLOG(1) << "panel: delete " << this; | 518 VLOG(1) << "panel: delete " << this; |
| 518 } | 519 } |
| 519 | 520 |
| 520 } // namespace chromeos | 521 } // namespace chromeos |
| OLD | NEW |