OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/app_list/views/start_page_view.h" | 5 #include "ui/app_list/views/start_page_view.h" |
6 | 6 |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
8 #include "ui/app_list/app_list_constants.h" | 8 #include "ui/app_list/app_list_constants.h" |
9 #include "ui/app_list/views/app_list_main_view.h" | 9 #include "ui/app_list/views/app_list_main_view.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // A button that is the placeholder for the search bar in the start page view. | 28 // A button that is the placeholder for the search bar in the start page view. |
29 class BarPlaceholderButton : public views::CustomButton { | 29 class BarPlaceholderButton : public views::CustomButton { |
30 public: | 30 public: |
31 explicit BarPlaceholderButton(views::ButtonListener* listener) | 31 explicit BarPlaceholderButton(views::ButtonListener* listener) |
32 : views::CustomButton(listener) {} | 32 : views::CustomButton(listener) {} |
33 | 33 |
34 virtual ~BarPlaceholderButton() {} | 34 virtual ~BarPlaceholderButton() {} |
35 | 35 |
36 // Overridden from views::View: | 36 // Overridden from views::View: |
37 virtual gfx::Size GetPreferredSize() OVERRIDE { | 37 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
38 return gfx::Size(kBarPlaceholderWidth, kBarPlaceholderHeight); | 38 return gfx::Size(kBarPlaceholderWidth, kBarPlaceholderHeight); |
39 } | 39 } |
40 | 40 |
41 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 41 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
42 PaintButton( | 42 PaintButton( |
43 canvas, | 43 canvas, |
44 state() == STATE_HOVERED ? kPagerHoverColor : kPagerNormalColor); | 44 state() == STATE_HOVERED ? kPagerHoverColor : kPagerNormalColor); |
45 } | 45 } |
46 | 46 |
47 private: | 47 private: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 instant_container_->SetVisible(true); | 88 instant_container_->SetVisible(true); |
89 } | 89 } |
90 | 90 |
91 void StartPageView::ButtonPressed(views::Button* sender, | 91 void StartPageView::ButtonPressed(views::Button* sender, |
92 const ui::Event& event) { | 92 const ui::Event& event) { |
93 app_list_main_view_->OnStartPageSearchButtonPressed(); | 93 app_list_main_view_->OnStartPageSearchButtonPressed(); |
94 instant_container_->SetVisible(false); | 94 instant_container_->SetVisible(false); |
95 } | 95 } |
96 | 96 |
97 } // namespace app_list | 97 } // namespace app_list |
OLD | NEW |