| 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/extensions/disabled_extensions_view.h" | 5 #include "chrome/browser/ui/views/extensions/disabled_extensions_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 15 #include "chrome/browser/ui/singleton_tabs.h" | 15 #include "chrome/browser/ui/singleton_tabs.h" |
| 16 #include "chrome/common/extensions/feature_switch.h" | 16 #include "chrome/common/extensions/feature_switch.h" |
| 17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 19 #include "content/public/browser/user_metrics.h" | 19 #include "content/public/browser/user_metrics.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "grit/locale_settings.h" | 21 #include "grit/locale_settings.h" |
| 22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
| 23 #include "ui/base/accessibility/accessible_view_state.h" | 23 #include "ui/base/accessibility/accessible_view_state.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/views/bubble/bubble_border.h" | 26 #include "ui/views/bubble/bubble_border.h" |
| 27 #include "ui/views/controls/button/text_button.h" | 27 #include "ui/views/controls/button/label_button.h" |
| 28 #include "ui/views/controls/image_view.h" | 28 #include "ui/views/controls/image_view.h" |
| 29 #include "ui/views/controls/label.h" | 29 #include "ui/views/controls/label.h" |
| 30 #include "ui/views/controls/link.h" | 30 #include "ui/views/controls/link.h" |
| 31 #include "ui/views/layout/grid_layout.h" | 31 #include "ui/views/layout/grid_layout.h" |
| 32 #include "ui/views/layout/layout_constants.h" | 32 #include "ui/views/layout/layout_constants.h" |
| 33 #include "ui/views/view_text_utils.h" | 33 #include "ui/views/view_text_utils.h" |
| 34 #include "ui/views/widget/widget.h" | 34 #include "ui/views/widget/widget.h" |
| 35 | 35 |
| 36 using content::UserMetricsAction; | 36 using content::UserMetricsAction; |
| 37 | 37 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 layout->AddPaddingRow(0, 7); | 275 layout->AddPaddingRow(0, 7); |
| 276 layout->StartRowWithPadding(0, action_row_column_set_id, | 276 layout->StartRowWithPadding(0, action_row_column_set_id, |
| 277 0, kMessageBubblePadding); | 277 0, kMessageBubblePadding); |
| 278 | 278 |
| 279 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); | 279 learn_more_ = new views::Link(l10n_util::GetStringUTF16(IDS_LEARN_MORE)); |
| 280 learn_more_->set_listener(this); | 280 learn_more_->set_listener(this); |
| 281 // We need to directly control where this link appears, so we don't add it to | 281 // We need to directly control where this link appears, so we don't add it to |
| 282 // the layout manager. | 282 // the layout manager. |
| 283 AddChildView(learn_more_); | 283 AddChildView(learn_more_); |
| 284 | 284 |
| 285 settings_button_ = new views::NativeTextButton(this, | 285 settings_button_ = new views::LabelButton(this, |
| 286 l10n_util::GetStringUTF16(IDS_OPTIONS_SIDELOAD_WIPEOUT_SETTINGS)); | 286 l10n_util::GetStringUTF16(IDS_OPTIONS_SIDELOAD_WIPEOUT_SETTINGS)); |
| 287 settings_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); |
| 287 layout->AddView(settings_button_); | 288 layout->AddView(settings_button_); |
| 288 dismiss_button_ = new views::NativeTextButton(this, | 289 dismiss_button_ = new views::LabelButton(this, |
| 289 l10n_util::GetStringUTF16(IDS_OPTIONS_SIDELOAD_WIPEOUT_DISMISS)); | 290 l10n_util::GetStringUTF16(IDS_OPTIONS_SIDELOAD_WIPEOUT_DISMISS)); |
| 291 dismiss_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); |
| 290 layout->AddView(dismiss_button_); | 292 layout->AddView(dismiss_button_); |
| 291 | 293 |
| 292 content::RecordAction( | 294 content::RecordAction( |
| 293 UserMetricsAction("DisabledExtensionNotificationShown")); | 295 UserMetricsAction("DisabledExtensionNotificationShown")); |
| 294 } | 296 } |
| 295 | 297 |
| 296 void DisabledExtensionsView::Paint(gfx::Canvas* canvas) { | 298 void DisabledExtensionsView::Paint(gfx::Canvas* canvas) { |
| 297 views::View::Paint(canvas); | 299 views::View::Paint(canvas); |
| 298 | 300 |
| 299 if (!link_offset_.width() && !link_offset_.height()) { | 301 if (!link_offset_.width() && !link_offset_.height()) { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 385 } |
| 384 | 386 |
| 385 void DisabledExtensionsView::ViewHierarchyChanged(bool is_add, | 387 void DisabledExtensionsView::ViewHierarchyChanged(bool is_add, |
| 386 View* parent, | 388 View* parent, |
| 387 View* child) { | 389 View* child) { |
| 388 if (is_add && child == this) { | 390 if (is_add && child == this) { |
| 389 GetWidget()->NotifyAccessibilityEvent( | 391 GetWidget()->NotifyAccessibilityEvent( |
| 390 this, ui::AccessibilityTypes::EVENT_ALERT, true); | 392 this, ui::AccessibilityTypes::EVENT_ALERT, true); |
| 391 } | 393 } |
| 392 } | 394 } |
| OLD | NEW |