Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 215017: Fix extension toolstrip background update code (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/views/frame/browser_view.h" 5 #include "chrome/browser/views/frame/browser_view.h"
6 6
7 #include "app/drag_drop_types.h" 7 #include "app/drag_drop_types.h"
8 #include "app/gfx/canvas.h" 8 #include "app/gfx/canvas.h"
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/os_exchange_data.h" 10 #include "app/os_exchange_data.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Draw the background to match the new tab page. 156 // Draw the background to match the new tab page.
157 DetachableToolbarView::PaintBackgroundDetachedMode(canvas, host_view_); 157 DetachableToolbarView::PaintBackgroundDetachedMode(canvas, host_view_);
158 158
159 SkRect rect; 159 SkRect rect;
160 160
161 // As 'hidden' according to the animation is the full in-tab state, 161 // As 'hidden' according to the animation is the full in-tab state,
162 // we invert the value - when current_state is at '0', we expect the 162 // we invert the value - when current_state is at '0', we expect the
163 // bar to be docked. 163 // bar to be docked.
164 double current_state = 1 - host_view_->GetAnimationValue(); 164 double current_state = 1 - host_view_->GetAnimationValue();
165 165
166 // The 0.5 is to correct for Skia's "draw on pixel boundaries"ness.
167 double h_padding = static_cast<double> 166 double h_padding = static_cast<double>
168 (BookmarkBarView::kNewtabHorizontalPadding) * current_state; 167 (BookmarkBarView::kNewtabHorizontalPadding) * current_state;
169 double v_padding = static_cast<double> 168 double v_padding = static_cast<double>
170 (BookmarkBarView::kNewtabVerticalPadding) * current_state; 169 (BookmarkBarView::kNewtabVerticalPadding) * current_state;
171 double roundness = 0; 170 double roundness = 0;
172 171
173 DetachableToolbarView::CalculateContentArea(current_state, 172 DetachableToolbarView::CalculateContentArea(current_state,
174 h_padding, v_padding, 173 h_padding, v_padding,
175 &rect, &roundness, host_view_); 174 &rect, &roundness, host_view_);
176 DetachableToolbarView::PaintContentAreaBackground( 175 DetachableToolbarView::PaintContentAreaBackground(
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2156 2155
2157 // static 2156 // static
2158 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 2157 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
2159 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 2158 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
2160 } 2159 }
2161 2160
2162 // static 2161 // static
2163 void BrowserList::AllBrowsersClosed() { 2162 void BrowserList::AllBrowsersClosed() {
2164 views::Window::CloseAllSecondaryWindows(); 2163 views::Window::CloseAllSecondaryWindows();
2165 } 2164 }
OLDNEW
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698