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/frame/glass_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 std::max(0, tabstrip_width), | 117 std::max(0, tabstrip_width), |
118 tabstrip->GetPreferredSize().height()); | 118 tabstrip->GetPreferredSize().height()); |
119 } | 119 } |
120 | 120 |
121 BrowserNonClientFrameView::TabStripInsets | 121 BrowserNonClientFrameView::TabStripInsets |
122 GlassBrowserFrameView::GetTabStripInsets(bool restored) const { | 122 GlassBrowserFrameView::GetTabStripInsets(bool restored) const { |
123 // TODO: include OTR and caption. | 123 // TODO: include OTR and caption. |
124 return TabStripInsets(NonClientTopBorderHeight(restored), 0, 0); | 124 return TabStripInsets(NonClientTopBorderHeight(restored), 0, 0); |
125 } | 125 } |
126 | 126 |
| 127 int GlassBrowserFrameView::GetThemeBackgroundXInset() const { |
| 128 return 0; |
| 129 } |
| 130 |
127 void GlassBrowserFrameView::UpdateThrobber(bool running) { | 131 void GlassBrowserFrameView::UpdateThrobber(bool running) { |
128 if (throbber_running_) { | 132 if (throbber_running_) { |
129 if (running) { | 133 if (running) { |
130 DisplayNextThrobberFrame(); | 134 DisplayNextThrobberFrame(); |
131 } else { | 135 } else { |
132 StopThrobber(); | 136 StopThrobber(); |
133 } | 137 } |
134 } else if (running) { | 138 } else if (running) { |
135 StartThrobber(); | 139 StartThrobber(); |
136 } | 140 } |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 browser_view()->browser()->search_model()->mode().mode); | 293 browser_view()->browser()->search_model()->mode().mode); |
290 gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed( | 294 gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed( |
291 IDR_CONTENT_TOP_LEFT_CORNER); | 295 IDR_CONTENT_TOP_LEFT_CORNER); |
292 gfx::ImageSkia* toolbar_center = tp->GetImageSkiaNamed( | 296 gfx::ImageSkia* toolbar_center = tp->GetImageSkiaNamed( |
293 IDR_CONTENT_TOP_CENTER); | 297 IDR_CONTENT_TOP_CENTER); |
294 | 298 |
295 // Tile the toolbar image starting at the frame edge on the left and where | 299 // Tile the toolbar image starting at the frame edge on the left and where |
296 // the tabstrip is on the top. | 300 // the tabstrip is on the top. |
297 int y = toolbar_bounds.y(); | 301 int y = toolbar_bounds.y(); |
298 int dest_y = y + (kFrameShadowThickness * 2); | 302 int dest_y = y + (kFrameShadowThickness * 2); |
299 canvas->TileImageInt(*theme_toolbar, x, | 303 canvas->TileImageInt(*theme_toolbar, |
| 304 x + GetThemeBackgroundXInset(), |
300 dest_y - GetTabStripInsets(false).top, x, | 305 dest_y - GetTabStripInsets(false).top, x, |
301 dest_y, w, theme_toolbar->height()); | 306 dest_y, w, theme_toolbar->height()); |
302 | 307 |
303 // Draw rounded corners for the tab. | 308 // Draw rounded corners for the tab. |
304 gfx::ImageSkia* toolbar_left_mask = | 309 gfx::ImageSkia* toolbar_left_mask = |
305 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); | 310 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_LEFT_CORNER_MASK); |
306 gfx::ImageSkia* toolbar_right_mask = | 311 gfx::ImageSkia* toolbar_right_mask = |
307 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); | 312 tp->GetImageSkiaNamed(IDR_CONTENT_TOP_RIGHT_CORNER_MASK); |
308 | 313 |
309 // We mask out the corners by using the DestinationIn transfer mode, | 314 // We mask out the corners by using the DestinationIn transfer mode, |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 static bool initialized = false; | 520 static bool initialized = false; |
516 if (!initialized) { | 521 if (!initialized) { |
517 for (int i = 0; i < kThrobberIconCount; ++i) { | 522 for (int i = 0; i < kThrobberIconCount; ++i) { |
518 throbber_icons_[i] = | 523 throbber_icons_[i] = |
519 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); | 524 ui::LoadThemeIconFromResourcesDataDLL(IDI_THROBBER_01 + i); |
520 DCHECK(throbber_icons_[i]); | 525 DCHECK(throbber_icons_[i]); |
521 } | 526 } |
522 initialized = true; | 527 initialized = true; |
523 } | 528 } |
524 } | 529 } |
OLD | NEW |