OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 using base::TimeDelta; | 158 using base::TimeDelta; |
159 using content::NativeWebKeyboardEvent; | 159 using content::NativeWebKeyboardEvent; |
160 using content::SSLStatus; | 160 using content::SSLStatus; |
161 using content::UserMetricsAction; | 161 using content::UserMetricsAction; |
162 using content::WebContents; | 162 using content::WebContents; |
163 using views::ColumnSet; | 163 using views::ColumnSet; |
164 using views::GridLayout; | 164 using views::GridLayout; |
165 using web_modal::WebContentsModalDialogHost; | 165 using web_modal::WebContentsModalDialogHost; |
166 | 166 |
167 namespace { | 167 namespace { |
168 // The height of the status bubble. | |
169 const int kStatusBubbleHeight = 20; | |
170 // The name of a key to store on the window handle so that other code can | 168 // The name of a key to store on the window handle so that other code can |
171 // locate this object using just the handle. | 169 // locate this object using just the handle. |
172 const char* const kBrowserViewKey = "__BROWSER_VIEW__"; | 170 const char* const kBrowserViewKey = "__BROWSER_VIEW__"; |
173 | 171 |
174 // The number of milliseconds between loading animation frames. | 172 // The number of milliseconds between loading animation frames. |
175 const int kLoadingAnimationFrameTimeMs = 30; | 173 const int kLoadingAnimationFrameTimeMs = 30; |
176 // The amount of space we expect the window border to take up. | |
177 const int kWindowBorderWidth = 5; | |
178 | |
179 // How round the 'new tab' style bookmarks bar is. | |
180 const int kNewtabBarRoundness = 5; | |
181 | 174 |
182 // TODO(kuan): These functions are temporarily for the bookmark bar while its | 175 // TODO(kuan): These functions are temporarily for the bookmark bar while its |
183 // detached state is at the top of the page; it'll be moved to float on the | 176 // detached state is at the top of the page; it'll be moved to float on the |
184 // content page in the very near future, at which time, these local functions | 177 // content page in the very near future, at which time, these local functions |
185 // will be removed. | 178 // will be removed. |
186 void PaintDetachedBookmarkBar(gfx::Canvas* canvas, | 179 void PaintDetachedBookmarkBar(gfx::Canvas* canvas, |
187 DetachableToolbarView* view, | 180 DetachableToolbarView* view, |
188 ThemeService* theme_service) { | 181 ThemeService* theme_service) { |
189 // Paint background for detached state; if animating, this is fade in/out. | 182 // Paint background for detached state; if animating, this is fade in/out. |
190 canvas->DrawColor( | 183 canvas->DrawColor( |
(...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2672 // The +1 in the next line creates a 1-px gap between icon and arrow tip. | 2665 // The +1 in the next line creates a 1-px gap between icon and arrow tip. |
2673 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - | 2666 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - |
2674 LocationBarView::kIconInternalPadding + 1); | 2667 LocationBarView::kIconInternalPadding + 1); |
2675 ConvertPointToTarget(location_icon_view, this, &icon_bottom); | 2668 ConvertPointToTarget(location_icon_view, this, &icon_bottom); |
2676 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2669 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
2677 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2670 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2678 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2671 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2679 } | 2672 } |
2680 return top_arrow_height; | 2673 return top_arrow_height; |
2681 } | 2674 } |
OLD | NEW |