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 "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/app_list/app_list_constants.h" | 8 #include "ui/app_list/app_list_constants.h" |
9 #include "ui/app_list/app_list_item.h" | 9 #include "ui/app_list/app_list_item.h" |
10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
24 #include "ui/views/controls/textfield/textfield.h" | 24 #include "ui/views/controls/textfield/textfield.h" |
25 #include "ui/views/layout/box_layout.h" | 25 #include "ui/views/layout/box_layout.h" |
26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
27 | 27 |
28 namespace app_list { | 28 namespace app_list { |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
32 // Layout constants. | 32 // Layout constants. |
33 const int kTopMargin = 84; | |
34 const int kInstantContainerSpacing = 11; | 33 const int kInstantContainerSpacing = 11; |
35 const int kSearchBoxAndTilesSpacing = 40; | 34 const int kSearchBoxAndTilesSpacing = 40; |
36 const int kStartPageSearchBoxWidth = 480; | 35 const int kStartPageSearchBoxWidth = 480; |
37 | 36 |
38 // WebView constants. | 37 // WebView constants. |
39 const int kWebViewWidth = 500; | 38 const int kWebViewWidth = 700; |
Matt Giuca
2015/01/29 08:00:53
How does this affect the normal doodle?
Is it jus
calamity
2015/01/30 05:09:14
Correct. |CSS is awe|some.
| |
40 const int kWebViewHeight = 105; | 39 const int kWebViewHeight = 189; |
41 | 40 |
42 // Tile container constants. | 41 // Tile container constants. |
43 const size_t kNumStartPageTiles = 4; | 42 const size_t kNumStartPageTiles = 4; |
44 const int kTileSpacing = 10; | 43 const int kTileSpacing = 10; |
45 | 44 |
46 // An invisible placeholder view which fills the space for the search box view | 45 // An invisible placeholder view which fills the space for the search box view |
47 // in a box layout. The search box view itself is a child of the AppListView | 46 // in a box layout. The search box view itself is a child of the AppListView |
48 // (because it is visible on many different pages). | 47 // (because it is visible on many different pages). |
49 class SearchBoxSpacerView : public views::View { | 48 class SearchBoxSpacerView : public views::View { |
50 public: | 49 public: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 Reset(); | 83 Reset(); |
85 } | 84 } |
86 | 85 |
87 StartPageView::~StartPageView() { | 86 StartPageView::~StartPageView() { |
88 } | 87 } |
89 | 88 |
90 void StartPageView::InitInstantContainer() { | 89 void StartPageView::InitInstantContainer() { |
91 views::BoxLayout* instant_layout_manager = new views::BoxLayout( | 90 views::BoxLayout* instant_layout_manager = new views::BoxLayout( |
92 views::BoxLayout::kVertical, 0, 0, kInstantContainerSpacing); | 91 views::BoxLayout::kVertical, 0, 0, kInstantContainerSpacing); |
93 instant_layout_manager->set_inside_border_insets( | 92 instant_layout_manager->set_inside_border_insets( |
94 gfx::Insets(kTopMargin, 0, kSearchBoxAndTilesSpacing, 0)); | 93 gfx::Insets(0, 0, kSearchBoxAndTilesSpacing, 0)); |
95 instant_layout_manager->set_main_axis_alignment( | 94 instant_layout_manager->set_main_axis_alignment( |
96 views::BoxLayout::MAIN_AXIS_ALIGNMENT_END); | 95 views::BoxLayout::MAIN_AXIS_ALIGNMENT_END); |
97 instant_layout_manager->set_cross_axis_alignment( | 96 instant_layout_manager->set_cross_axis_alignment( |
98 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); | 97 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); |
99 instant_container_->SetLayoutManager(instant_layout_manager); | 98 instant_container_->SetLayoutManager(instant_layout_manager); |
100 | 99 |
101 views::View* web_view = view_delegate_->CreateStartPageWebView( | 100 views::View* web_view = view_delegate_->CreateStartPageWebView( |
102 gfx::Size(kWebViewWidth, kWebViewHeight)); | 101 gfx::Size(kWebViewWidth, kWebViewHeight)); |
103 if (web_view) { | 102 if (web_view) { |
104 web_view->SetFocusable(false); | 103 web_view->SetFocusable(false); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 | 262 |
264 TileItemView* StartPageView::GetTileItemView(size_t index) { | 263 TileItemView* StartPageView::GetTileItemView(size_t index) { |
265 DCHECK_GT(kNumStartPageTiles + 1, index); | 264 DCHECK_GT(kNumStartPageTiles + 1, index); |
266 if (index == kNumStartPageTiles) | 265 if (index == kNumStartPageTiles) |
267 return all_apps_button_; | 266 return all_apps_button_; |
268 | 267 |
269 return search_result_tile_views_[index]; | 268 return search_result_tile_views_[index]; |
270 } | 269 } |
271 | 270 |
272 } // namespace app_list | 271 } // namespace app_list |
OLD | NEW |