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

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

Issue 340003002: Revert of views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 #include "ui/app_list/views/search_box_view.h" 5 #include "ui/app_list/views/search_box_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "grit/ui_resources.h" 9 #include "grit/ui_resources.h"
10 #include "ui/app_list/app_list_model.h" 10 #include "ui/app_list/app_list_model.h"
11 #include "ui/app_list/app_list_view_delegate.h" 11 #include "ui/app_list/app_list_view_delegate.h"
12 #include "ui/app_list/search_box_model.h" 12 #include "ui/app_list/search_box_model.h"
13 #include "ui/app_list/speech_ui_model.h" 13 #include "ui/app_list/speech_ui_model.h"
14 #include "ui/app_list/views/app_list_menu_views.h" 14 #include "ui/app_list/views/app_list_menu_views.h"
15 #include "ui/app_list/views/search_box_view_delegate.h" 15 #include "ui/app_list/views/search_box_view_delegate.h"
16 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
17 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/events/event.h" 18 #include "ui/events/event.h"
19 #include "ui/views/border.h"
20 #include "ui/views/controls/button/image_button.h" 19 #include "ui/views/controls/button/image_button.h"
21 #include "ui/views/controls/button/menu_button.h" 20 #include "ui/views/controls/button/menu_button.h"
22 #include "ui/views/controls/image_view.h" 21 #include "ui/views/controls/image_view.h"
23 #include "ui/views/controls/textfield/textfield.h" 22 #include "ui/views/controls/textfield/textfield.h"
24 23
25 namespace app_list { 24 namespace app_list {
26 25
27 namespace { 26 namespace {
28 27
29 const int kPadding = 14; 28 const int kPadding = 14;
(...skipping 21 matching lines...) Expand all
51 speech_button_(NULL), 50 speech_button_(NULL),
52 search_box_(new views::Textfield), 51 search_box_(new views::Textfield),
53 contents_view_(NULL) { 52 contents_view_(NULL) {
54 AddChildView(icon_view_); 53 AddChildView(icon_view_);
55 54
56 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
57 56
58 #if !defined(OS_CHROMEOS) 57 #if !defined(OS_CHROMEOS)
59 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false); 58 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false);
60 menu_button_->SetBorder(views::Border::NullBorder()); 59 menu_button_->SetBorder(views::Border::NullBorder());
61 menu_button_->SetImage(views::Button::STATE_NORMAL, 60 menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL));
62 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL)); 61 menu_button_->SetHoverIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER));
63 menu_button_->SetImage(views::Button::STATE_HOVERED, 62 menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed(
64 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER)); 63 IDR_APP_LIST_TOOLS_PRESSED));
65 menu_button_->SetImage(views::Button::STATE_PRESSED,
66 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_PRESSED));
67 AddChildView(menu_button_); 64 AddChildView(menu_button_);
68 #endif 65 #endif
69 66
70 search_box_->SetBorder(views::Border::NullBorder()); 67 search_box_->SetBorder(views::Border::NullBorder());
71 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); 68 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
72 search_box_->set_placeholder_text_color(kHintTextColor); 69 search_box_->set_placeholder_text_color(kHintTextColor);
73 search_box_->set_controller(this); 70 search_box_->set_controller(this);
74 AddChildView(search_box_); 71 AddChildView(search_box_);
75 72
76 view_delegate_->GetSpeechUI()->AddObserver(this); 73 view_delegate_->GetSpeechUI()->AddObserver(this);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 NotifyQueryChanged(); 253 NotifyQueryChanged();
257 } 254 }
258 255
259 void SearchBoxView::OnSpeechRecognitionStateChanged( 256 void SearchBoxView::OnSpeechRecognitionStateChanged(
260 SpeechRecognitionState new_state) { 257 SpeechRecognitionState new_state) {
261 SpeechRecognitionButtonPropChanged(); 258 SpeechRecognitionButtonPropChanged();
262 SchedulePaint(); 259 SchedulePaint();
263 } 260 }
264 261
265 } // namespace app_list 262 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/website_settings/permissions_bubble_view.cc ('k') | ui/message_center/views/notifier_settings_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698