| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/search/search_ui.h" |
| 6 |
| 7 #include "ui/gfx/rect.h" |
| 8 #include "ui/gfx/size.h" |
| 9 |
| 10 namespace chrome { |
| 11 namespace search { |
| 12 |
| 13 const SkColor kNTPBackgroundColor = SkColorSetRGB(0xF5, 0xF5, 0xF5); |
| 14 const SkColor kResultsSeparatorColor = SkColorSetRGB(226, 226, 226); |
| 15 const SkColor kSearchBackgroundColor = SK_ColorWHITE; |
| 16 |
| 17 const int kOmniboxYPosition = 310; |
| 18 const int kSearchResultsHeight = 122; |
| 19 |
| 20 gfx::Rect GetNTPOmniboxBounds(const gfx::Size& web_contents_size) { |
| 21 const double kNTPPageWidthRatio = 0.73f; |
| 22 if (web_contents_size.IsEmpty()) |
| 23 return gfx::Rect(); |
| 24 int width = static_cast<int>(kNTPPageWidthRatio * |
| 25 static_cast<double>(web_contents_size.width())); |
| 26 int x = (web_contents_size.width() - width) / 2; |
| 27 return gfx::Rect(x, kOmniboxYPosition, width, 0); |
| 28 } |
| 29 |
| 30 } // namespace search |
| 31 } // namespace chrome |
| OLD | NEW |