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/app_non_client_frame_view_aura.h" | 5 #include "chrome/browser/ui/views/frame/app_non_client_frame_view_aura.h" |
6 | 6 |
7 #include "base/debug/stack_trace.h" | 7 #include "base/debug/stack_trace.h" |
8 #include "chrome/browser/ui/views/frame/browser_frame.h" | 8 #include "chrome/browser/ui/views/frame/browser_frame.h" |
9 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
10 #include "grit/generated_resources.h" // Accessibility names | 10 #include "grit/generated_resources.h" // Accessibility names |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 }; | 158 }; |
159 | 159 |
160 class AppNonClientFrameViewAura::Host : public views::MouseWatcherHost { | 160 class AppNonClientFrameViewAura::Host : public views::MouseWatcherHost { |
161 public: | 161 public: |
162 explicit Host(AppNonClientFrameViewAura* owner) : owner_(owner) {} | 162 explicit Host(AppNonClientFrameViewAura* owner) : owner_(owner) {} |
163 virtual ~Host() {} | 163 virtual ~Host() {} |
164 | 164 |
165 virtual bool Contains( | 165 virtual bool Contains( |
166 const gfx::Point& screen_point, | 166 const gfx::Point& screen_point, |
167 views::MouseWatcherHost::MouseEventType type) OVERRIDE { | 167 views::MouseWatcherHost::MouseEventType type) OVERRIDE { |
168 gfx::Rect top_margin = owner_->GetScreenBounds(); | 168 gfx::Rect top_margin = owner_->GetBoundsInScreen(); |
169 top_margin.set_height(kTopMargin); | 169 top_margin.set_height(kTopMargin); |
170 gfx::Rect control_bounds = owner_->GetControlBounds(); | 170 gfx::Rect control_bounds = owner_->GetControlBounds(); |
171 control_bounds.Inset(kShadowStart, 0, 0, kShadowStart); | 171 control_bounds.Inset(kShadowStart, 0, 0, kShadowStart); |
172 return top_margin.Contains(screen_point) || | 172 return top_margin.Contains(screen_point) || |
173 control_bounds.Contains(screen_point); | 173 control_bounds.Contains(screen_point); |
174 } | 174 } |
175 | 175 |
176 private: | 176 private: |
177 AppNonClientFrameViewAura* owner_; | 177 AppNonClientFrameViewAura* owner_; |
178 | 178 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 bool AppNonClientFrameViewAura::IsShowingControls() const { | 324 bool AppNonClientFrameViewAura::IsShowingControls() const { |
325 return control_widget_ && control_widget_->IsVisible(); | 325 return control_widget_ && control_widget_->IsVisible(); |
326 } | 326 } |
327 | 327 |
328 void AppNonClientFrameViewAura::Restore() { | 328 void AppNonClientFrameViewAura::Restore() { |
329 if (control_widget_) | 329 if (control_widget_) |
330 control_widget_->Close(); | 330 control_widget_->Close(); |
331 mouse_watcher_.Stop(); | 331 mouse_watcher_.Stop(); |
332 frame()->Restore(); | 332 frame()->Restore(); |
333 } | 333 } |
OLD | NEW |