| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 void GlassBrowserFrameView::Layout() { | 259 void GlassBrowserFrameView::Layout() { |
| 260 LayoutOTRAvatar(); | 260 LayoutOTRAvatar(); |
| 261 LayoutClientView(); | 261 LayoutClientView(); |
| 262 LayoutProfileTag(); | 262 LayoutProfileTag(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const { | 265 bool GlassBrowserFrameView::HitTest(const gfx::Point& l) const { |
| 266 // The ProfileMenuButton intrudes into the client area when the window is | 266 // The ProfileMenuButton intrudes into the client area when the window is |
| 267 // maximized. | 267 // maximized. |
| 268 if (frame_->GetWindow()->IsMaximized() && show_profile_button() && | 268 return (frame_->GetWindow()->IsMaximized() && show_profile_button() && |
| 269 profile_button_->IsVisible() && | 269 profile_button_->IsVisible() && |
| 270 profile_button_->GetMirroredBounds().Contains(l)) { | 270 profile_button_->GetMirroredBounds().Contains(l)) || |
| 271 return true; | 271 !GetWindow()->client_view()->bounds().Contains(l); |
| 272 } else { | |
| 273 return !GetWindow()->client_view()->bounds().Contains(l); | |
| 274 } | |
| 275 } | 272 } |
| 276 | 273 |
| 277 /////////////////////////////////////////////////////////////////////////////// | 274 /////////////////////////////////////////////////////////////////////////////// |
| 278 // GlassBrowserFrameView, private: | 275 // GlassBrowserFrameView, private: |
| 279 | 276 |
| 280 int GlassBrowserFrameView::FrameBorderThickness() const { | 277 int GlassBrowserFrameView::FrameBorderThickness() const { |
| 281 views::Window* window = frame_->GetWindow(); | 278 views::Window* window = frame_->GetWindow(); |
| 282 return (window->IsMaximized() || window->IsFullscreen()) ? | 279 return (window->IsMaximized() || window->IsFullscreen()) ? |
| 283 0 : GetSystemMetrics(SM_CXSIZEFRAME); | 280 0 : GetSystemMetrics(SM_CXSIZEFRAME); |
| 284 } | 281 } |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 static bool initialized = false; | 619 static bool initialized = false; |
| 623 if (!initialized) { | 620 if (!initialized) { |
| 624 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); | 621 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); |
| 625 for (int i = 0; i < kThrobberIconCount; ++i) { | 622 for (int i = 0; i < kThrobberIconCount; ++i) { |
| 626 throbber_icons_[i] = rb.LoadThemeIcon(IDI_THROBBER_01 + i); | 623 throbber_icons_[i] = rb.LoadThemeIcon(IDI_THROBBER_01 + i); |
| 627 DCHECK(throbber_icons_[i]); | 624 DCHECK(throbber_icons_[i]); |
| 628 } | 625 } |
| 629 initialized = true; | 626 initialized = true; |
| 630 } | 627 } |
| 631 } | 628 } |
| OLD | NEW |