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

Side by Side Diff: views/bubble/bubble_delegate.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
OLDNEW
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 "views/bubble/bubble_delegate.h" 5 #include "views/bubble/bubble_delegate.h"
6 6
7 #include "ui/base/animation/slide_animation.h" 7 #include "ui/base/animation/slide_animation.h"
8 #include "views/bubble/bubble_frame_view.h" 8 #include "views/bubble/bubble_frame_view.h"
9 #include "views/widget/widget.h" 9 #include "views/widget/widget.h"
10 10
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 } 191 }
192 192
193 void BubbleDelegateView::ResetFade() { 193 void BubbleDelegateView::ResetFade() {
194 fade_animation_.reset(); 194 fade_animation_.reset();
195 if (border_widget_) 195 if (border_widget_)
196 border_widget_->SetOpacity(original_opacity_); 196 border_widget_->SetOpacity(original_opacity_);
197 GetWidget()->SetOpacity(original_opacity_); 197 GetWidget()->SetOpacity(original_opacity_);
198 } 198 }
199 199
200 bool BubbleDelegateView::AcceleratorPressed(const Accelerator& accelerator) { 200 bool BubbleDelegateView::AcceleratorPressed(
201 const ui::Accelerator& accelerator) {
201 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE) 202 if (!close_on_esc() || accelerator.key_code() != ui::VKEY_ESCAPE)
202 return false; 203 return false;
203 if (fade_animation_.get()) 204 if (fade_animation_.get())
204 fade_animation_->Reset(); 205 fade_animation_->Reset();
205 GetWidget()->Close(); 206 GetWidget()->Close();
206 return true; 207 return true;
207 } 208 }
208 209
209 void BubbleDelegateView::Init() {} 210 void BubbleDelegateView::Init() {}
210 211
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 258 }
258 259
259 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { 260 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const {
260 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); 261 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView());
261 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin()); 262 client_bounds.Offset(border_widget_->GetWindowScreenBounds().origin());
262 return client_bounds; 263 return client_bounds;
263 } 264 }
264 #endif 265 #endif
265 266
266 } // namespace views 267 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698