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

Side by Side Diff: ui/app_list/views/search_box_view.h

Issue 894203004: Add a proper shadow to the experimental app list search box. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make_doodle_clickable
Patch Set: fix_test Created 5 years, 10 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
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_VIEWS_SEARCH_BOX_VIEW_H_ 5 #ifndef UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ 6 #define UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "ui/app_list/search_box_model_observer.h" 10 #include "ui/app_list/search_box_model_observer.h"
(...skipping 30 matching lines...) Expand all
41 public: 41 public:
42 SearchBoxView(SearchBoxViewDelegate* delegate, 42 SearchBoxView(SearchBoxViewDelegate* delegate,
43 AppListViewDelegate* view_delegate); 43 AppListViewDelegate* view_delegate);
44 ~SearchBoxView() override; 44 ~SearchBoxView() override;
45 45
46 void ModelChanged(); 46 void ModelChanged();
47 bool HasSearch() const; 47 bool HasSearch() const;
48 void ClearSearch(); 48 void ClearSearch();
49 void InvalidateMenu(); 49 void InvalidateMenu();
50 50
51 // Returns the bounds to use for the view (including the shadow) given the
52 // desired bounds of the search box contents.
53 gfx::Rect GetViewBoundsForSearchBoxContentsBounds(const gfx::Rect& rect);
tapted 2015/02/03 23:56:31 nit: declare const?
calamity 2015/02/04 03:37:02 Done.
54
51 views::ImageButton* back_button() { return back_button_; } 55 views::ImageButton* back_button() { return back_button_; }
52 views::Textfield* search_box() { return search_box_; } 56 views::Textfield* search_box() { return search_box_; }
53 57
54 void set_contents_view(views::View* contents_view) { 58 void set_contents_view(views::View* contents_view) {
55 contents_view_ = contents_view; 59 contents_view_ = contents_view;
56 } 60 }
57 61
58 // Overridden from views::View: 62 // Overridden from views::View:
59 gfx::Size GetPreferredSize() const override; 63 gfx::Size GetPreferredSize() const override;
60 bool OnMouseWheel(const ui::MouseWheelEvent& event) override; 64 bool OnMouseWheel(const ui::MouseWheelEvent& event) override;
(...skipping 28 matching lines...) Expand all
89 // Overridden from SpeechUIModelObserver: 93 // Overridden from SpeechUIModelObserver:
90 void OnSpeechRecognitionStateChanged( 94 void OnSpeechRecognitionStateChanged(
91 SpeechRecognitionState new_state) override; 95 SpeechRecognitionState new_state) override;
92 96
93 SearchBoxViewDelegate* delegate_; // Not owned. 97 SearchBoxViewDelegate* delegate_; // Not owned.
94 AppListViewDelegate* view_delegate_; // Not owned. 98 AppListViewDelegate* view_delegate_; // Not owned.
95 AppListModel* model_; // Owned by the profile-keyed service. 99 AppListModel* model_; // Owned by the profile-keyed service.
96 100
97 scoped_ptr<AppListMenuViews> menu_; 101 scoped_ptr<AppListMenuViews> menu_;
98 102
103 views::View* content_container_; // Owned by views hierarchy.
99 views::ImageView* icon_view_; // Owned by views hierarchy. 104 views::ImageView* icon_view_; // Owned by views hierarchy.
100 views::ImageButton* back_button_; // Owned by views hierarchy. 105 views::ImageButton* back_button_; // Owned by views hierarchy.
101 views::ImageButton* speech_button_; // Owned by views hierarchy. 106 views::ImageButton* speech_button_; // Owned by views hierarchy.
102 views::MenuButton* menu_button_; // Owned by views hierarchy. 107 views::MenuButton* menu_button_; // Owned by views hierarchy.
103 views::Textfield* search_box_; // Owned by views hierarchy. 108 views::Textfield* search_box_; // Owned by views hierarchy.
104 views::View* contents_view_; // Owned by views hierarchy. 109 views::View* contents_view_; // Owned by views hierarchy.
105 110
106 DISALLOW_COPY_AND_ASSIGN(SearchBoxView); 111 DISALLOW_COPY_AND_ASSIGN(SearchBoxView);
107 }; 112 };
108 113
109 } // namespace app_list 114 } // namespace app_list
110 115
111 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_ 116 #endif // UI_APP_LIST_VIEWS_SEARCH_BOX_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698