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

Side by Side Diff: ui/app_list/app_list_bubble_border.h

Issue 10386224: app_list: Add search box and search result view for v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, rename and add chrome search Created 8 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ 5 #ifndef UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_
6 #define UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ 6 #define UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/views/bubble/bubble_border.h" 10 #include "ui/views/bubble/bubble_border.h"
11 11
12 namespace app_list { 12 namespace app_list {
13 13
14 // A class to paint bubble border and background. 14 // A class to paint bubble border and background.
15 class AppListBubbleBorder : public views::BubbleBorder { 15 class AppListBubbleBorder : public views::BubbleBorder {
16 public: 16 public:
17 explicit AppListBubbleBorder(views::View* app_list_view); 17 explicit AppListBubbleBorder(views::View* app_list_view);
18 virtual ~AppListBubbleBorder(); 18 virtual ~AppListBubbleBorder();
19 19
20 int arrow_offset() const { 20 int arrow_offset() const {
21 return arrow_offset_; 21 return arrow_offset_;
22 } 22 }
23 void set_arrow_offset(int arrow_offset) { 23 void set_arrow_offset(int arrow_offset) {
24 arrow_offset_ = arrow_offset; 24 arrow_offset_ = arrow_offset;
25 } 25 }
26 26
27 private: 27 private:
28 void PaintModelViewBackground(gfx::Canvas* canvas, 28 void PaintSearchBoxBackground(gfx::Canvas* canvas,
29 const gfx::Rect& bounds) const; 29 const gfx::Rect& bounds) const;
30 void PaintSearchResultListBackground(gfx::Canvas* canvas,
31 const gfx::Rect& bounds) const;
32 void PaintAppsGridBackground(gfx::Canvas* canvas,
33 const gfx::Rect& bounds) const;
30 void PaintPageSwitcherBackground(gfx::Canvas* canvas, 34 void PaintPageSwitcherBackground(gfx::Canvas* canvas,
31 const gfx::Rect& bounds) const; 35 const gfx::Rect& bounds) const;
32 36
33 // views::BubbleBorder overrides: 37 // views::BubbleBorder overrides:
34 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE; 38 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE;
35 virtual gfx::Rect GetBounds(const gfx::Rect& position_relative_to, 39 virtual gfx::Rect GetBounds(const gfx::Rect& position_relative_to,
36 const gfx::Size& contents_size) const OVERRIDE; 40 const gfx::Size& contents_size) const OVERRIDE;
37 41
38 // views::Border overrides: 42 // views::Border overrides:
39 virtual void Paint(const views::View& view, 43 virtual void Paint(const views::View& view,
40 gfx::Canvas* canvas) const OVERRIDE; 44 gfx::Canvas* canvas) const OVERRIDE;
41 45
42 // AppListView hosted inside this bubble. 46 // AppListView hosted inside this bubble.
43 views::View* app_list_view_; 47 views::View* app_list_view_;
44 48
45 // Offset in pixels relative the default middle position. 49 // Offset in pixels relative the default middle position.
46 int arrow_offset_; 50 int arrow_offset_;
47 51
48 DISALLOW_COPY_AND_ASSIGN(AppListBubbleBorder); 52 DISALLOW_COPY_AND_ASSIGN(AppListBubbleBorder);
49 }; 53 };
50 54
51 } // namespace app_list 55 } // namespace app_list
52 56
53 #endif // UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_ 57 #endif // UI_APP_LIST_APP_LIST_BUBBLE_BORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698