| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/chromeos/compact_navigation_bar.h" | 5 #include "chrome/browser/chromeos/compact_navigation_bar.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "app/theme_provider.h" | 9 #include "app/theme_provider.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // URL bar. | 120 // URL bar. |
| 121 location_entry_view_->SetBounds(curx + kURLPadding, 0, | 121 location_entry_view_->SetBounds(curx + kURLPadding, 0, |
| 122 kURLWidth + kURLPadding * 2, height()); | 122 kURLWidth + kURLPadding * 2, height()); |
| 123 curx += kURLWidth + kHorizPadding + kURLPadding * 2; | 123 curx += kURLWidth + kHorizPadding + kURLPadding * 2; |
| 124 } | 124 } |
| 125 | 125 |
| 126 void CompactNavigationBar::Paint(gfx::Canvas* canvas) { | 126 void CompactNavigationBar::Paint(gfx::Canvas* canvas) { |
| 127 ThemeProvider* theme = browser_->profile()->GetThemeProvider(); | 127 ThemeProvider* theme = browser_->profile()->GetThemeProvider(); |
| 128 | 128 |
| 129 // Fill the background. | 129 // Fill the background. |
| 130 SkBitmap* background; | 130 int image_name; |
| 131 if (browser_->window()->IsActive()) | 131 if (browser_->window()->IsActive()) { |
| 132 background = theme->GetBitmapNamed(IDR_THEME_FRAME); | 132 image_name = browser_->profile()->IsOffTheRecord() ? |
| 133 else | 133 IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; |
| 134 background = theme->GetBitmapNamed(IDR_THEME_FRAME_INACTIVE); | 134 } else { |
| 135 image_name = browser_->profile()->IsOffTheRecord() ? |
| 136 IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE; |
| 137 } |
| 138 SkBitmap* background = theme->GetBitmapNamed(image_name); |
| 135 canvas->TileImageInt(*background, 0, 0, width(), height()); | 139 canvas->TileImageInt(*background, 0, 0, width(), height()); |
| 136 | 140 |
| 137 // Draw a white box around the edit field so that it looks larger. This is | 141 // Draw a white box around the edit field so that it looks larger. This is |
| 138 // kind of what the default GTK location bar does, although they have a | 142 // kind of what the default GTK location bar does, although they have a |
| 139 // fancier border. | 143 // fancier border. |
| 140 canvas->FillRectInt(0xFFFFFFFF, | 144 canvas->FillRectInt(0xFFFFFFFF, |
| 141 location_entry_view_->x() - kURLPadding, | 145 location_entry_view_->x() - kURLPadding, |
| 142 2, | 146 2, |
| 143 location_entry_view_->width() + kURLPadding * 2, | 147 location_entry_view_->width() + kURLPadding * 2, |
| 144 height() - 5); | 148 height() - 5); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 browser_->GetSelectedTabContents()->controller().LoadURL( | 211 browser_->GetSelectedTabContents()->controller().LoadURL( |
| 208 url, GURL(), transition); | 212 url, GURL(), transition); |
| 209 break; | 213 break; |
| 210 } | 214 } |
| 211 case StatusAreaView::OPEN_TABS_ON_RIGHT: { | 215 case StatusAreaView::OPEN_TABS_ON_RIGHT: { |
| 212 browser_->AddTabWithURL(url, GURL(), transition, true, -1, true, NULL); | 216 browser_->AddTabWithURL(url, GURL(), transition, true, -1, true, NULL); |
| 213 break; | 217 break; |
| 214 } | 218 } |
| 215 } | 219 } |
| 216 } | 220 } |
| OLD | NEW |