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

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods and vars to make image_scale more clear Created 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/opaque_browser_frame_view_layout.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/views/tab_icon_view.h" 9 #include "chrome/browser/ui/views/tab_icon_view.h"
10 #include "chrome/browser/ui/views/tabs/tab.h" 10 #include "chrome/browser/ui/views/tabs/tab.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 virtual bool ShouldShowAvatar() const OVERRIDE { 79 virtual bool ShouldShowAvatar() const OVERRIDE {
80 return show_avatar_; 80 return show_avatar_;
81 } 81 }
82 82
83 virtual gfx::ImageSkia GetOTRAvatarIcon() const OVERRIDE { 83 virtual gfx::ImageSkia GetOTRAvatarIcon() const OVERRIDE {
84 // The calculations depend on the size of the OTR resource, and chromeos 84 // The calculations depend on the size of the OTR resource, and chromeos
85 // uses a different sized image, so hard code the size of the current 85 // uses a different sized image, so hard code the size of the current
86 // windows/linux one. 86 // windows/linux one.
87 gfx::ImageSkiaRep rep(gfx::Size(40, 29), ui::SCALE_FACTOR_100P); 87 gfx::ImageSkiaRep rep(gfx::Size(40, 29), 1.0f);
88 gfx::ImageSkia image(rep); 88 gfx::ImageSkia image(rep);
89 return image; 89 return image;
90 } 90 }
91 91
92 virtual bool IsMaximized() const OVERRIDE { 92 virtual bool IsMaximized() const OVERRIDE {
93 return window_state_ == STATE_MAXIMIZED; 93 return window_state_ == STATE_MAXIMIZED;
94 } 94 }
95 95
96 virtual bool IsMinimized() const OVERRIDE { 96 virtual bool IsMinimized() const OVERRIDE {
97 return window_state_ == STATE_MINIMIZED; 97 return window_state_ == STATE_MINIMIZED;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 virtual void TearDown() OVERRIDE { 166 virtual void TearDown() OVERRIDE {
167 widget_->CloseNow(); 167 widget_->CloseNow();
168 168
169 views::ViewsTestBase::TearDown(); 169 views::ViewsTestBase::TearDown();
170 } 170 }
171 171
172 protected: 172 protected:
173 views::ImageButton* InitWindowCaptionButton(ViewID view_id, 173 views::ImageButton* InitWindowCaptionButton(ViewID view_id,
174 const gfx::Size& size) { 174 const gfx::Size& size) {
175 views::ImageButton* button = new views::ImageButton(NULL); 175 views::ImageButton* button = new views::ImageButton(NULL);
176 gfx::ImageSkiaRep rep(size, ui::SCALE_FACTOR_100P); 176 gfx::ImageSkiaRep rep(size, 1.0f);
177 gfx::ImageSkia image(rep); 177 gfx::ImageSkia image(rep);
178 button->SetImage(views::CustomButton::STATE_NORMAL, &image); 178 button->SetImage(views::CustomButton::STATE_NORMAL, &image);
179 button->set_id(view_id); 179 button->set_id(view_id);
180 root_view_->AddChildView(button); 180 root_view_->AddChildView(button);
181 return button; 181 return button;
182 } 182 }
183 183
184 void AddWindowTitleIcons() { 184 void AddWindowTitleIcons() {
185 tab_icon_view_ = new TabIconView(NULL); 185 tab_icon_view_ = new TabIconView(NULL);
186 tab_icon_view_->set_is_light(true); 186 tab_icon_view_->set_is_light(true);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 ExpectBasicWindowBounds(); 297 ExpectBasicWindowBounds();
298 298
299 // Check the location of the avatar 299 // Check the location of the avatar
300 EXPECT_EQ("7,11 40x29", menu_button_->bounds().ToString()); 300 EXPECT_EQ("7,11 40x29", menu_button_->bounds().ToString());
301 EXPECT_EQ("45,13 352x29", 301 EXPECT_EQ("45,13 352x29",
302 layout_manager_->GetBoundsForTabStrip( 302 layout_manager_->GetBoundsForTabStrip(
303 delegate_->GetTabstripPreferredSize(), kWidth).ToString()); 303 delegate_->GetTabstripPreferredSize(), kWidth).ToString());
304 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString()); 304 EXPECT_EQ("261x73", layout_manager_->GetMinimumSize(kWidth).ToString());
305 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698