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

Side by Side Diff: chrome/browser/chromeos/panels/panel_scroller_header.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. 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) 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/panels/panel_scroller_header.h" 5 #include "chrome/browser/chromeos/panels/panel_scroller_header.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/panels/panel_scroller.h" 8 #include "chrome/browser/chromeos/panels/panel_scroller.h"
9 #include "ui/base/resource/resource_bundle.h" 9 #include "ui/base/resource/resource_bundle.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
11 #include "ui/gfx/font.h" 11 #include "ui/gfx/font.h"
12 12
13 PanelScrollerHeader::PanelScrollerHeader(PanelScroller* scroller) 13 PanelScrollerHeader::PanelScrollerHeader(PanelScroller* scroller)
14 : views::View(), 14 : views::View(),
15 scroller_(scroller) { 15 scroller_(scroller) {
16 } 16 }
17 17
18 PanelScrollerHeader::~PanelScrollerHeader() { 18 PanelScrollerHeader::~PanelScrollerHeader() {
19 } 19 }
20 20
21 bool PanelScrollerHeader::OnMousePressed(const views::MouseEvent& event) { 21 bool PanelScrollerHeader::OnMousePressed(const views::MouseEvent& event) {
22 return true; 22 return true;
23 } 23 }
24 24
25 bool PanelScrollerHeader::OnMouseDragged(const views::MouseEvent& event) { 25 bool PanelScrollerHeader::OnMouseDragged(const views::MouseEvent& event) {
26 return false; 26 return false;
27 } 27 }
28 28
29 void PanelScrollerHeader::OnMouseReleased(const views::MouseEvent& event, 29 void PanelScrollerHeader::OnMouseReleased(const views::MouseEvent& event) {
30 bool canceled) { 30 OnMouseCaptureLost();
31 }
32
33 void PanelScrollerHeader::OnMouseCaptureLost() {
31 scroller_->HeaderClicked(this); 34 scroller_->HeaderClicked(this);
32 } 35 }
33 36
34 gfx::Size PanelScrollerHeader::GetPreferredSize() { 37 gfx::Size PanelScrollerHeader::GetPreferredSize() {
35 return gfx::Size(size().width(), 18); 38 return gfx::Size(size().width(), 18);
36 } 39 }
37 40
38 void PanelScrollerHeader::OnPaint(gfx::Canvas* canvas) { 41 void PanelScrollerHeader::OnPaint(gfx::Canvas* canvas) {
39 // TODO(brettw) fill this out with real styling. 42 // TODO(brettw) fill this out with real styling.
40 canvas->FillRectInt(0xFFFFFFFF, 0, 0, size().width(), size().height()); 43 canvas->FillRectInt(0xFFFFFFFF, 0, 0, size().width(), size().height());
41 canvas->DrawLineInt(0xFFE6E6E6, 0, size().height() - 1, 44 canvas->DrawLineInt(0xFFE6E6E6, 0, size().height() - 1,
42 size().width(), size().height() - 1); 45 size().width(), size().height() - 1);
43 46
44 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 47 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
45 gfx::Font font = 48 gfx::Font font =
46 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD); 49 rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, gfx::Font::BOLD);
47 int font_top = 1; 50 int font_top = 1;
48 canvas->DrawStringInt(title_, font, 0xFF000000, 3, font_top, 51 canvas->DrawStringInt(title_, font, 0xFF000000, 3, font_top,
49 size().width(), size().height() - font_top); 52 size().width(), size().height() - font_top);
50 } 53 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/panels/panel_scroller_header.h ('k') | chrome/browser/renderer_host/render_widget_host_view_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698