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

Side by Side Diff: chrome/browser/chromeos/frame/panel_controller.h

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address most TODOs and sync. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_ 6 #define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <gtk/gtk.h> 9 #include <gtk/gtk.h>
10 10
11 #include "third_party/cros/chromeos_wm_ipc_enums.h" 11 #include "third_party/cros/chromeos_wm_ipc_enums.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 PanelController(Delegate* delegate_window, 55 PanelController(Delegate* delegate_window,
56 GtkWindow* window); 56 GtkWindow* window);
57 virtual ~PanelController() {} 57 virtual ~PanelController() {}
58 58
59 // Initializes the panel controller with the initial state of the focus and 59 // Initializes the panel controller with the initial state of the focus and
60 // the window bounds. 60 // the window bounds.
61 void Init(bool initial_focus, const gfx::Rect& init_bounds, XID creator_xid, 61 void Init(bool initial_focus, const gfx::Rect& init_bounds, XID creator_xid,
62 WmIpcPanelUserResizeType resize_type); 62 WmIpcPanelUserResizeType resize_type);
63 63
64 bool TitleMousePressed(const views::MouseEvent& event); 64 bool TitleMousePressed(const views::MouseEvent& event);
65 void TitleMouseReleased(const views::MouseEvent& event, bool canceled);
66 bool TitleMouseDragged(const views::MouseEvent& event); 65 bool TitleMouseDragged(const views::MouseEvent& event);
66 void TitleMouseReleased(const views::MouseEvent& event);
67 void TitleMouseCaptureLost();
67 bool PanelClientEvent(GdkEventClient* event); 68 bool PanelClientEvent(GdkEventClient* event);
68 void OnFocusIn(); 69 void OnFocusIn();
69 void OnFocusOut(); 70 void OnFocusOut();
70 71
71 void UpdateTitleBar(); 72 void UpdateTitleBar();
72 void Close(); 73 void Close();
73 74
74 void SetState(State state); 75 void SetState(State state);
75 76
76 private: 77 private:
77 class TitleContentView : public views::View, 78 class TitleContentView : public views::View,
78 public views::ButtonListener { 79 public views::ButtonListener {
79 public: 80 public:
80 explicit TitleContentView(PanelController* panelController); 81 explicit TitleContentView(PanelController* panelController);
81 virtual ~TitleContentView(); 82 virtual ~TitleContentView();
82 virtual void Layout();
83 virtual bool OnMousePressed(const views::MouseEvent& event);
84 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled);
85 virtual bool OnMouseDragged(const views::MouseEvent& event);
86 void OnFocusIn(); 83 void OnFocusIn();
87 void OnFocusOut(); 84 void OnFocusOut();
88 void OnClose(); 85 void OnClose();
89 86
90 views::ImageView* title_icon() { return title_icon_; } 87 views::ImageView* title_icon() { return title_icon_; }
91 views::Label* title_label() { return title_label_; } 88 views::Label* title_label() { return title_label_; }
92 views::ImageButton* close_button() { return close_button_; } 89 views::ImageButton* close_button() { return close_button_; }
93 90
91 // Overridden from View:
92 virtual void Layout() OVERRIDE;
93 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
94 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE;
95 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;
96 virtual void OnMouseCaptureLost() OVERRIDE;
97
94 // ButtonListener methods. 98 // ButtonListener methods.
95 virtual void ButtonPressed(views::Button* sender, 99 virtual void ButtonPressed(views::Button* sender,
96 const views::Event& event); 100 const views::Event& event) OVERRIDE;
97 private: 101 private:
98 views::ImageView* title_icon_; 102 views::ImageView* title_icon_;
99 views::Label* title_label_; 103 views::Label* title_label_;
100 views::ImageButton* close_button_; 104 views::ImageButton* close_button_;
101 PanelController* panel_controller_; 105 PanelController* panel_controller_;
102 DISALLOW_COPY_AND_ASSIGN(TitleContentView); 106 DISALLOW_COPY_AND_ASSIGN(TitleContentView);
103 }; 107 };
104 108
105 // Called from TitleContentView's ButtonPressed handler. 109 // Called from TitleContentView's ButtonPressed handler.
106 void OnCloseButtonPressed(); 110 void OnCloseButtonPressed();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 154
151 // GTK client event handler id. 155 // GTK client event handler id.
152 int client_event_handler_id_; 156 int client_event_handler_id_;
153 157
154 DISALLOW_COPY_AND_ASSIGN(PanelController); 158 DISALLOW_COPY_AND_ASSIGN(PanelController);
155 }; 159 };
156 160
157 } // namespace chromeos 161 } // namespace chromeos
158 162
159 #endif // CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_ 163 #endif // CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698