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

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

Issue 298813002: views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDirectlyToSecondWindow. 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"
19 #include "ui/views/controls/button/image_button.h" 20 #include "ui/views/controls/button/image_button.h"
20 #include "ui/views/controls/button/menu_button.h" 21 #include "ui/views/controls/button/menu_button.h"
21 #include "ui/views/controls/image_view.h" 22 #include "ui/views/controls/image_view.h"
22 #include "ui/views/controls/textfield/textfield.h" 23 #include "ui/views/controls/textfield/textfield.h"
23 24
24 namespace app_list { 25 namespace app_list {
25 26
26 namespace { 27 namespace {
27 28
28 const int kPadding = 14; 29 const int kPadding = 14;
(...skipping 21 matching lines...) Expand all
50 speech_button_(NULL), 51 speech_button_(NULL),
51 search_box_(new views::Textfield), 52 search_box_(new views::Textfield),
52 contents_view_(NULL) { 53 contents_view_(NULL) {
53 AddChildView(icon_view_); 54 AddChildView(icon_view_);
54 55
55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 56 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
56 57
57 #if !defined(OS_CHROMEOS) 58 #if !defined(OS_CHROMEOS)
58 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false); 59 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false);
59 menu_button_->SetBorder(views::Border::NullBorder()); 60 menu_button_->SetBorder(views::Border::NullBorder());
60 menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL)); 61 menu_button_->SetImage(views::Button::STATE_NORMAL,
61 menu_button_->SetHoverIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER)); 62 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL));
62 menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed( 63 menu_button_->SetImage(views::Button::STATE_HOVERED,
63 IDR_APP_LIST_TOOLS_PRESSED)); 64 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER));
65 menu_button_->SetImage(views::Button::STATE_PRESSED,
66 *rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_PRESSED));
64 AddChildView(menu_button_); 67 AddChildView(menu_button_);
65 #endif 68 #endif
66 69
67 search_box_->SetBorder(views::Border::NullBorder()); 70 search_box_->SetBorder(views::Border::NullBorder());
68 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); 71 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont));
69 search_box_->set_placeholder_text_color(kHintTextColor); 72 search_box_->set_placeholder_text_color(kHintTextColor);
70 search_box_->set_controller(this); 73 search_box_->set_controller(this);
71 AddChildView(search_box_); 74 AddChildView(search_box_);
72 75
73 view_delegate_->GetSpeechUI()->AddObserver(this); 76 view_delegate_->GetSpeechUI()->AddObserver(this);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NotifyQueryChanged(); 256 NotifyQueryChanged();
254 } 257 }
255 258
256 void SearchBoxView::OnSpeechRecognitionStateChanged( 259 void SearchBoxView::OnSpeechRecognitionStateChanged(
257 SpeechRecognitionState new_state) { 260 SpeechRecognitionState new_state) {
258 SpeechRecognitionButtonPropChanged(); 261 SpeechRecognitionButtonPropChanged();
259 SchedulePaint(); 262 SchedulePaint();
260 } 263 }
261 264
262 } // namespace app_list 265 } // 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