| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/screen_capture_notification_ui.h" | 5 #include "chrome/browser/ui/screen_capture_notification_ui.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/ui/views/chrome_views_export.h" | 9 #include "chrome/browser/ui/views/chrome_views_export.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // ScreenCaptureNotificationUI interface. | 89 // ScreenCaptureNotificationUI interface. |
| 90 gfx::NativeViewId OnStarted(const base::Closure& stop_callback) override; | 90 gfx::NativeViewId OnStarted(const base::Closure& stop_callback) override; |
| 91 | 91 |
| 92 // views::View overrides. | 92 // views::View overrides. |
| 93 gfx::Size GetPreferredSize() const override; | 93 gfx::Size GetPreferredSize() const override; |
| 94 void Layout() override; | 94 void Layout() override; |
| 95 | 95 |
| 96 // views::WidgetDelegateView overrides. | 96 // views::WidgetDelegateView overrides. |
| 97 void DeleteDelegate() override; | 97 void DeleteDelegate() override; |
| 98 views::View* GetContentsView() override; | |
| 99 views::ClientView* CreateClientView(views::Widget* widget) override; | 98 views::ClientView* CreateClientView(views::Widget* widget) override; |
| 100 views::NonClientFrameView* CreateNonClientFrameView( | 99 views::NonClientFrameView* CreateNonClientFrameView( |
| 101 views::Widget* widget) override; | 100 views::Widget* widget) override; |
| 102 base::string16 GetWindowTitle() const override; | 101 base::string16 GetWindowTitle() const override; |
| 103 bool ShouldShowWindowTitle() const override; | 102 bool ShouldShowWindowTitle() const override; |
| 104 bool ShouldShowCloseButton() const override; | 103 bool ShouldShowCloseButton() const override; |
| 105 bool CanActivate() const override; | 104 bool CanActivate() const override; |
| 106 | 105 |
| 107 // views::ButtonListener interface. | 106 // views::ButtonListener interface. |
| 108 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 107 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 client_view_->set_client_rect(gfx::Rect( | 259 client_view_->set_client_rect(gfx::Rect( |
| 261 stop_button_rect.x(), stop_button_rect.y(), | 260 stop_button_rect.x(), stop_button_rect.y(), |
| 262 stop_button_rect.width() + kHorizontalMargin + hide_link_rect.width(), | 261 stop_button_rect.width() + kHorizontalMargin + hide_link_rect.width(), |
| 263 std::max(stop_button_rect.height(), hide_link_rect.height()))); | 262 std::max(stop_button_rect.height(), hide_link_rect.height()))); |
| 264 } | 263 } |
| 265 | 264 |
| 266 void ScreenCaptureNotificationUIViews::DeleteDelegate() { | 265 void ScreenCaptureNotificationUIViews::DeleteDelegate() { |
| 267 NotifyStopped(); | 266 NotifyStopped(); |
| 268 } | 267 } |
| 269 | 268 |
| 270 views::View* ScreenCaptureNotificationUIViews::GetContentsView() { | |
| 271 return this; | |
| 272 } | |
| 273 | |
| 274 views::ClientView* ScreenCaptureNotificationUIViews::CreateClientView( | 269 views::ClientView* ScreenCaptureNotificationUIViews::CreateClientView( |
| 275 views::Widget* widget) { | 270 views::Widget* widget) { |
| 276 DCHECK(!client_view_); | 271 DCHECK(!client_view_); |
| 277 client_view_ = new NotificationBarClientView(widget, this); | 272 client_view_ = new NotificationBarClientView(widget, this); |
| 278 return client_view_; | 273 return client_view_; |
| 279 } | 274 } |
| 280 | 275 |
| 281 views::NonClientFrameView* | 276 views::NonClientFrameView* |
| 282 ScreenCaptureNotificationUIViews::CreateNonClientFrameView( | 277 ScreenCaptureNotificationUIViews::CreateNonClientFrameView( |
| 283 views::Widget* widget) { | 278 views::Widget* widget) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 324 } |
| 330 } | 325 } |
| 331 | 326 |
| 332 } // namespace | 327 } // namespace |
| 333 | 328 |
| 334 std::unique_ptr<ScreenCaptureNotificationUI> | 329 std::unique_ptr<ScreenCaptureNotificationUI> |
| 335 ScreenCaptureNotificationUI::Create(const base::string16& text) { | 330 ScreenCaptureNotificationUI::Create(const base::string16& text) { |
| 336 return std::unique_ptr<ScreenCaptureNotificationUI>( | 331 return std::unique_ptr<ScreenCaptureNotificationUI>( |
| 337 new ScreenCaptureNotificationUIViews(text)); | 332 new ScreenCaptureNotificationUIViews(text)); |
| 338 } | 333 } |
| OLD | NEW |