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/global_error_bubble_view.h" | 5 #include "chrome/browser/ui/views/global_error_bubble_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/ui/global_error/global_error.h" | 8 #include "chrome/browser/ui/global_error/global_error.h" |
9 #include "chrome/browser/ui/global_error/global_error_service.h" | 9 #include "chrome/browser/ui/global_error/global_error_service.h" |
10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 GlobalErrorBubbleView::~GlobalErrorBubbleView() { | 145 GlobalErrorBubbleView::~GlobalErrorBubbleView() { |
146 } | 146 } |
147 | 147 |
148 gfx::Rect GlobalErrorBubbleView::GetAnchorRect() { | 148 gfx::Rect GlobalErrorBubbleView::GetAnchorRect() { |
149 gfx::Rect rect(views::BubbleDelegateView::GetAnchorRect()); | 149 gfx::Rect rect(views::BubbleDelegateView::GetAnchorRect()); |
150 rect.Inset(0, anchor_view() ? kAnchorVerticalInset : 0); | 150 rect.Inset(0, anchor_view() ? kAnchorVerticalInset : 0); |
151 return rect; | 151 return rect; |
152 } | 152 } |
153 | 153 |
154 void GlobalErrorBubbleView::ButtonPressed(views::Button* sender, | 154 void GlobalErrorBubbleView::ButtonPressed(views::Button* sender, |
155 const views::Event& event) { | 155 const ui::Event& event) { |
156 if (error_) { | 156 if (error_) { |
157 if (sender->tag() == TAG_ACCEPT_BUTTON) | 157 if (sender->tag() == TAG_ACCEPT_BUTTON) |
158 error_->BubbleViewAcceptButtonPressed(browser_); | 158 error_->BubbleViewAcceptButtonPressed(browser_); |
159 else if (sender->tag() == TAG_CANCEL_BUTTON) | 159 else if (sender->tag() == TAG_CANCEL_BUTTON) |
160 error_->BubbleViewCancelButtonPressed(browser_); | 160 error_->BubbleViewCancelButtonPressed(browser_); |
161 else | 161 else |
162 NOTREACHED(); | 162 NOTREACHED(); |
163 } | 163 } |
164 GetWidget()->Close(); | 164 GetWidget()->Close(); |
165 } | 165 } |
166 | 166 |
167 void GlobalErrorBubbleView::WindowClosing() { | 167 void GlobalErrorBubbleView::WindowClosing() { |
168 if (error_) | 168 if (error_) |
169 error_->BubbleViewDidClose(browser_); | 169 error_->BubbleViewDidClose(browser_); |
170 } | 170 } |
171 | 171 |
172 void GlobalErrorBubbleView::CloseBubbleView() { | 172 void GlobalErrorBubbleView::CloseBubbleView() { |
173 GetWidget()->Close(); | 173 GetWidget()->Close(); |
174 } | 174 } |
OLD | NEW |