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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.h" |
9 #include "chrome/browser/themes/theme_service_factory.h" | 9 #include "chrome/browser/themes/theme_service_factory.h" |
10 #include "chrome/browser/ui/layout_constants.h" | 10 #include "chrome/browser/ui/layout_constants.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void OpaqueBrowserFrameView::UpdateThrobber(bool running) { | 149 void OpaqueBrowserFrameView::UpdateThrobber(bool running) { |
150 if (window_icon_) | 150 if (window_icon_) |
151 window_icon_->Update(); | 151 window_icon_->Update(); |
152 } | 152 } |
153 | 153 |
154 gfx::Size OpaqueBrowserFrameView::GetMinimumSize() const { | 154 gfx::Size OpaqueBrowserFrameView::GetMinimumSize() const { |
155 return layout_->GetMinimumSize(width()); | 155 return layout_->GetMinimumSize(width()); |
156 } | 156 } |
157 | 157 |
158 views::View* OpaqueBrowserFrameView::GetProfileSwitcherView() const { | 158 views::View* OpaqueBrowserFrameView::GetProfileSwitcherView() const { |
159 return profile_switcher_.view(); | 159 return profile_switcher_.button(); |
160 } | 160 } |
161 | 161 |
162 /////////////////////////////////////////////////////////////////////////////// | 162 /////////////////////////////////////////////////////////////////////////////// |
163 // OpaqueBrowserFrameView, views::NonClientFrameView implementation: | 163 // OpaqueBrowserFrameView, views::NonClientFrameView implementation: |
164 | 164 |
165 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const { | 165 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const { |
166 return layout_->client_view_bounds(); | 166 return layout_->client_view_bounds(); |
167 } | 167 } |
168 | 168 |
169 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( | 169 gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( |
170 const gfx::Rect& client_bounds) const { | 170 const gfx::Rect& client_bounds) const { |
171 return layout_->GetWindowBoundsForClientBounds(client_bounds); | 171 return layout_->GetWindowBoundsForClientBounds(client_bounds); |
172 } | 172 } |
173 | 173 |
174 bool OpaqueBrowserFrameView::IsWithinAvatarMenuButtons( | 174 bool OpaqueBrowserFrameView::IsWithinAvatarMenuButtons( |
175 const gfx::Point& point) const { | 175 const gfx::Point& point) const { |
176 if (profile_indicator_icon() && | 176 if (profile_indicator_icon() && |
177 profile_indicator_icon()->GetMirroredBounds().Contains(point)) { | 177 profile_indicator_icon()->GetMirroredBounds().Contains(point)) { |
178 return true; | 178 return true; |
179 } | 179 } |
180 if (profile_switcher_.view() && | 180 if (profile_switcher_.button() && |
181 profile_switcher_.view()->GetMirroredBounds().Contains(point)) { | 181 profile_switcher_.button()->GetMirroredBounds().Contains(point)) { |
182 return true; | 182 return true; |
183 } | 183 } |
184 | 184 |
185 return false; | 185 return false; |
186 } | 186 } |
187 | 187 |
188 int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { | 188 int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { |
189 if (!bounds().Contains(point)) | 189 if (!bounds().Contains(point)) |
190 return HTNOWHERE; | 190 return HTNOWHERE; |
191 | 191 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 gfx::Rect side(x, y, kClientEdgeThickness, h); | 663 gfx::Rect side(x, y, kClientEdgeThickness, h); |
664 canvas->FillRect(side, color); | 664 canvas->FillRect(side, color); |
665 if (draw_bottom) { | 665 if (draw_bottom) { |
666 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), | 666 canvas->FillRect(gfx::Rect(x, y + h, w + (2 * kClientEdgeThickness), |
667 kClientEdgeThickness), | 667 kClientEdgeThickness), |
668 color); | 668 color); |
669 } | 669 } |
670 side.Offset(w + kClientEdgeThickness, 0); | 670 side.Offset(w + kClientEdgeThickness, 0); |
671 canvas->FillRect(side, color); | 671 canvas->FillRect(side, color); |
672 } | 672 } |
OLD | NEW |