| 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" |
| 11 #include "chrome/grit/theme_resources.h" | 11 #include "chrome/grit/theme_resources.h" |
| 12 #include "ui/base/hit_test.h" | 12 #include "ui/base/hit_test.h" |
| 13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
| 14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 15 #include "ui/display/display.h" | 15 #include "ui/display/display.h" |
| 16 #include "ui/display/screen.h" | 16 #include "ui/display/screen.h" |
| 17 #include "ui/views/bubble/bubble_border.h" | 17 #include "ui/views/bubble/bubble_border.h" |
| 18 #include "ui/views/bubble/bubble_frame_view.h" | 18 #include "ui/views/bubble/bubble_frame_view.h" |
| 19 #include "ui/views/controls/button/blue_button.h" | 19 #include "ui/views/controls/button/md_text_button.h" |
| 20 #include "ui/views/controls/image_view.h" | 20 #include "ui/views/controls/image_view.h" |
| 21 #include "ui/views/controls/link.h" | 21 #include "ui/views/controls/link.h" |
| 22 #include "ui/views/controls/link_listener.h" | 22 #include "ui/views/controls/link_listener.h" |
| 23 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
| 24 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
| 25 #include "ui/views/widget/widget_delegate.h" | 25 #include "ui/views/widget/widget_delegate.h" |
| 26 #include "ui/wm/core/shadow_types.h" | 26 #include "ui/wm/core/shadow_types.h" |
| 27 | 27 |
| 28 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 29 #include "ui/views/win/hwnd_util.h" | 29 #include "ui/views/win/hwnd_util.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 // Helper to call |stop_callback_|. | 114 // Helper to call |stop_callback_|. |
| 115 void NotifyStopped(); | 115 void NotifyStopped(); |
| 116 | 116 |
| 117 const base::string16 text_; | 117 const base::string16 text_; |
| 118 base::Closure stop_callback_; | 118 base::Closure stop_callback_; |
| 119 NotificationBarClientView* client_view_; | 119 NotificationBarClientView* client_view_; |
| 120 views::ImageView* gripper_; | 120 views::ImageView* gripper_; |
| 121 views::Label* label_; | 121 views::Label* label_; |
| 122 views::BlueButton* stop_button_; | 122 views::Button* stop_button_; |
| 123 views::Link* hide_link_; | 123 views::Link* hide_link_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUIViews); | 125 DISALLOW_COPY_AND_ASSIGN(ScreenCaptureNotificationUIViews); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 ScreenCaptureNotificationUIViews::ScreenCaptureNotificationUIViews( | 128 ScreenCaptureNotificationUIViews::ScreenCaptureNotificationUIViews( |
| 129 const base::string16& text) | 129 const base::string16& text) |
| 130 : text_(text), | 130 : text_(text), |
| 131 client_view_(NULL), | 131 client_view_(nullptr), |
| 132 gripper_(NULL), | 132 gripper_(nullptr), |
| 133 label_(NULL), | 133 label_(nullptr), |
| 134 stop_button_(NULL), | 134 stop_button_(nullptr), |
| 135 hide_link_(NULL) { | 135 hide_link_(nullptr) { |
| 136 set_owned_by_client(); | 136 set_owned_by_client(); |
| 137 | 137 |
| 138 gripper_ = new views::ImageView(); | 138 gripper_ = new views::ImageView(); |
| 139 gripper_->SetImage( | 139 gripper_->SetImage( |
| 140 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 140 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 141 IDR_SCREEN_CAPTURE_NOTIFICATION_GRIP)); | 141 IDR_SCREEN_CAPTURE_NOTIFICATION_GRIP)); |
| 142 AddChildView(gripper_); | 142 AddChildView(gripper_); |
| 143 | 143 |
| 144 label_ = new views::Label(); | 144 label_ = new views::Label(); |
| 145 AddChildView(label_); | 145 AddChildView(label_); |
| 146 | 146 |
| 147 base::string16 stop_text = | 147 base::string16 stop_text = |
| 148 l10n_util::GetStringUTF16(IDS_MEDIA_SCREEN_CAPTURE_NOTIFICATION_STOP); | 148 l10n_util::GetStringUTF16(IDS_MEDIA_SCREEN_CAPTURE_NOTIFICATION_STOP); |
| 149 stop_button_ = new views::BlueButton(this, stop_text); | 149 stop_button_ = |
| 150 views::MdTextButton::CreateSecondaryUiBlueButton(this, stop_text); |
| 150 AddChildView(stop_button_); | 151 AddChildView(stop_button_); |
| 151 | 152 |
| 152 // TODO(jiayl): IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON is used for the need to | 153 // TODO(jiayl): IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON is used for the need to |
| 153 // merge to M34. Change it to a new IDS_ after the merge. | 154 // merge to M34. Change it to a new IDS_ after the merge. |
| 154 hide_link_ = new views::Link( | 155 hide_link_ = new views::Link( |
| 155 l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON)); | 156 l10n_util::GetStringUTF16(IDS_PASSWORDS_PAGE_VIEW_HIDE_BUTTON)); |
| 156 hide_link_->set_listener(this); | 157 hide_link_->set_listener(this); |
| 157 hide_link_->SetUnderline(false); | 158 hide_link_->SetUnderline(false); |
| 158 AddChildView(hide_link_); | 159 AddChildView(hide_link_); |
| 159 } | 160 } |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 329 } |
| 329 } | 330 } |
| 330 | 331 |
| 331 } // namespace | 332 } // namespace |
| 332 | 333 |
| 333 std::unique_ptr<ScreenCaptureNotificationUI> | 334 std::unique_ptr<ScreenCaptureNotificationUI> |
| 334 ScreenCaptureNotificationUI::Create(const base::string16& text) { | 335 ScreenCaptureNotificationUI::Create(const base::string16& text) { |
| 335 return std::unique_ptr<ScreenCaptureNotificationUI>( | 336 return std::unique_ptr<ScreenCaptureNotificationUI>( |
| 336 new ScreenCaptureNotificationUIViews(text)); | 337 new ScreenCaptureNotificationUIViews(text)); |
| 337 } | 338 } |
| OLD | NEW |