| 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/location_bar/zoom_bubble_view.h" | 5 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_finder.h" | 11 #include "chrome/browser/ui/browser_finder.h" |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/views/frame/browser_view.h" | 14 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 16 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 16 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
| 17 #include "chrome/common/extensions/api/extension_action/action_info.h" | 17 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 18 #include "chrome/grit/generated_resources.h" | 18 #include "chrome/grit/generated_resources.h" |
| 19 #include "components/ui/zoom/page_zoom.h" | 19 #include "components/ui/zoom/page_zoom.h" |
| 20 #include "components/ui/zoom/zoom_controller.h" | 20 #include "components/ui/zoom/zoom_controller.h" |
| 21 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
| 22 #include "extensions/browser/extension_zoom_request_client.h" | 22 #include "extensions/browser/extension_zoom_request_client.h" |
| 23 #include "extensions/common/manifest_handlers/icons_handler.h" | 23 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 24 #include "grit/theme_resources.h" | 24 #include "grit/theme_resources.h" |
| 25 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 26 #include "ui/base/resource/resource_bundle.h" |
| 27 #include "ui/gfx/favicon_size.h" | 27 #include "ui/gfx/favicon_size.h" |
| 28 #include "ui/views/controls/button/image_button.h" | 28 #include "ui/views/controls/button/image_button.h" |
| 29 #include "ui/views/controls/button/label_button.h" | 29 #include "ui/views/controls/button/md_text_button.h" |
| 30 #include "ui/views/controls/separator.h" | 30 #include "ui/views/controls/separator.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/widget/widget.h" | 33 #include "ui/views/widget/widget.h" |
| 34 | 34 |
| 35 // static | 35 // static |
| 36 ZoomBubbleView* ZoomBubbleView::zoom_bubble_ = NULL; | 36 ZoomBubbleView* ZoomBubbleView::zoom_bubble_ = NULL; |
| 37 | 37 |
| 38 // static | 38 // static |
| 39 void ZoomBubbleView::ShowBubble(content::WebContents* web_contents, | 39 void ZoomBubbleView::ShowBubble(content::WebContents* web_contents, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 grid_layout->AddView(label_); | 183 grid_layout->AddView(label_); |
| 184 | 184 |
| 185 // Second row. | 185 // Second row. |
| 186 grid_layout->AddPaddingRow(0, 8); | 186 grid_layout->AddPaddingRow(0, 8); |
| 187 columns = grid_layout->AddColumnSet(1); | 187 columns = grid_layout->AddColumnSet(1); |
| 188 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, | 188 columns->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, |
| 189 views::GridLayout::USE_PREF, 0, 0); | 189 views::GridLayout::USE_PREF, 0, 0); |
| 190 grid_layout->StartRow(0, 1); | 190 grid_layout->StartRow(0, 1); |
| 191 | 191 |
| 192 // Add "Reset to Default" button. | 192 // Add "Reset to Default" button. |
| 193 views::LabelButton* set_default_button = new views::LabelButton( | 193 grid_layout->AddView( |
| 194 this, l10n_util::GetStringUTF16(IDS_ZOOM_SET_DEFAULT)); | 194 views::MdTextButton::CreateSecondaryUiButton( |
| 195 set_default_button->SetStyle(views::Button::STYLE_BUTTON); | 195 this, l10n_util::GetStringUTF16(IDS_ZOOM_SET_DEFAULT))); |
| 196 grid_layout->AddView(set_default_button); | |
| 197 | 196 |
| 198 StartTimerIfNecessary(); | 197 StartTimerIfNecessary(); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void ZoomBubbleView::WindowClosing() { | 200 void ZoomBubbleView::WindowClosing() { |
| 202 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't | 201 // |zoom_bubble_| can be a new bubble by this point (as Close(); doesn't |
| 203 // call this right away). Only set to NULL when it's this bubble. | 202 // call this right away). Only set to NULL when it's this bubble. |
| 204 if (zoom_bubble_ == this) | 203 if (zoom_bubble_ == this) |
| 205 zoom_bubble_ = NULL; | 204 zoom_bubble_ = NULL; |
| 206 } | 205 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 310 } |
| 312 } | 311 } |
| 313 | 312 |
| 314 void ZoomBubbleView::StopTimer() { | 313 void ZoomBubbleView::StopTimer() { |
| 315 timer_.Stop(); | 314 timer_.Stop(); |
| 316 } | 315 } |
| 317 | 316 |
| 318 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} | 317 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} |
| 319 | 318 |
| 320 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} | 319 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} |
| OLD | NEW |