OLD | NEW |
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 "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 #include "ui/compositor/layer.h" | 107 #include "ui/compositor/layer.h" |
108 #include "ui/compositor/scoped_layer_animation_settings.h" | 108 #include "ui/compositor/scoped_layer_animation_settings.h" |
109 #endif | 109 #endif |
110 | 110 |
111 using content::WebContents; | 111 using content::WebContents; |
112 using views::View; | 112 using views::View; |
113 | 113 |
114 | 114 |
115 namespace { | 115 namespace { |
116 | 116 |
| 117 #if !defined(OS_CHROMEOS) |
117 Browser* GetBrowserFromDelegate(LocationBarView::Delegate* delegate) { | 118 Browser* GetBrowserFromDelegate(LocationBarView::Delegate* delegate) { |
118 WebContents* contents = delegate->GetWebContents(); | 119 WebContents* contents = delegate->GetWebContents(); |
119 return contents ? chrome::FindBrowserWithWebContents(contents) : NULL; | 120 return contents ? chrome::FindBrowserWithWebContents(contents) : NULL; |
120 } | 121 } |
| 122 #endif |
121 | 123 |
122 // Given a containing |height| and a |base_font_list|, shrinks the font size | 124 // Given a containing |height| and a |base_font_list|, shrinks the font size |
123 // until the font list will fit within |height| while having its cap height | 125 // until the font list will fit within |height| while having its cap height |
124 // vertically centered. Returns the correctly-sized font list. | 126 // vertically centered. Returns the correctly-sized font list. |
125 // | 127 // |
126 // The expected layout: | 128 // The expected layout: |
127 // +--------+-----------------------------------------------+------------+ | 129 // +--------+-----------------------------------------------+------------+ |
128 // | | y offset | space | | 130 // | | y offset | space | |
129 // | +--------+-------------------+------------------+ above | | 131 // | +--------+-------------------+------------------+ above | |
130 // | | | | internal leading | cap height | | 132 // | | | | internal leading | cap height | |
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1567 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
1566 location_bar_util::PaintExtensionActionBackground( | 1568 location_bar_util::PaintExtensionActionBackground( |
1567 *(*page_action_view)->image_view()->page_action(), | 1569 *(*page_action_view)->image_view()->page_action(), |
1568 tab_id, canvas, bounds, text_color, background_color); | 1570 tab_id, canvas, bounds, text_color, background_color); |
1569 } | 1571 } |
1570 } | 1572 } |
1571 | 1573 |
1572 void LocationBarView::AccessibilitySetValue(const string16& new_value) { | 1574 void LocationBarView::AccessibilitySetValue(const string16& new_value) { |
1573 location_entry_->SetUserText(new_value); | 1575 location_entry_->SetUserText(new_value); |
1574 } | 1576 } |
OLD | NEW |