OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/first_run_search_engine_view.h" | 5 #include "chrome/browser/ui/views/first_run_search_engine_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/base/accessibility/accessible_view_state.h" | 28 #include "ui/base/accessibility/accessible_view_state.h" |
29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
31 #include "ui/gfx/canvas.h" | 31 #include "ui/gfx/canvas.h" |
32 #include "ui/gfx/font.h" | 32 #include "ui/gfx/font.h" |
33 #include "ui/views/controls/button/button.h" | 33 #include "ui/views/controls/button/button.h" |
34 #include "ui/views/controls/image_view.h" | 34 #include "ui/views/controls/image_view.h" |
35 #include "ui/views/controls/label.h" | 35 #include "ui/views/controls/label.h" |
36 #include "ui/views/focus/accelerator_handler.h" | 36 #include "ui/views/focus/accelerator_handler.h" |
37 #include "ui/views/layout/layout_constants.h" | 37 #include "ui/views/layout/layout_constants.h" |
| 38 #include "ui/views/view_text_utils.h" |
38 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
39 #include "views/view_text_utils.h" | |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Size to scale logos down to if showing 4 instead of 3 choices. Logo images | 43 // Size to scale logos down to if showing 4 instead of 3 choices. Logo images |
44 // are all originally sized at 180 x 120 pixels, with the logo text baseline | 44 // are all originally sized at 180 x 120 pixels, with the logo text baseline |
45 // located 74 pixels beneath the top of the image. | 45 // located 74 pixels beneath the top of the image. |
46 const int kSmallLogoWidth = 132; | 46 const int kSmallLogoWidth = 132; |
47 const int kSmallLogoHeight = 88; | 47 const int kSmallLogoHeight = 88; |
48 | 48 |
49 // Used to pad text label height so it fits nicely in view. | 49 // Used to pad text label height so it fits nicely in view. |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 } | 476 } |
477 | 477 |
478 void FirstRunSearchEngineView::ChooseSearchEngine(SearchEngineChoice* choice) { | 478 void FirstRunSearchEngineView::ChooseSearchEngine(SearchEngineChoice* choice) { |
479 user_chosen_engine_ = true; | 479 user_chosen_engine_ = true; |
480 DCHECK(template_url_service_); | 480 DCHECK(template_url_service_); |
481 template_url_service_->SetSearchEngineDialogSlot(choice->slot()); | 481 template_url_service_->SetSearchEngineDialogSlot(choice->slot()); |
482 const TemplateURL* default_search = choice->GetSearchEngine(); | 482 const TemplateURL* default_search = choice->GetSearchEngine(); |
483 if (default_search) | 483 if (default_search) |
484 template_url_service_->SetDefaultSearchProvider(default_search); | 484 template_url_service_->SetDefaultSearchProvider(default_search); |
485 } | 485 } |
OLD | NEW |