| 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/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/platform_util.h" | 11 #include "chrome/browser/platform_util.h" |
| 12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
| 13 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 14 #include "chrome/browser/ui/browser_tabstrip.h" | 15 #include "chrome/browser/ui/browser_tabstrip.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 17 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 18 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 18 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 19 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
| 19 #include "chrome/common/extensions/api/extension_action/action_info.h" | 20 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 20 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
| 21 #include "chrome/grit/theme_resources.h" | 22 #include "chrome/grit/theme_resources.h" |
| 22 #include "components/zoom/page_zoom.h" | 23 #include "components/zoom/page_zoom.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 : LocationBarBubbleDelegateView(anchor_view, anchor_point, web_contents), | 148 : LocationBarBubbleDelegateView(anchor_view, anchor_point, web_contents), |
| 148 image_button_(nullptr), | 149 image_button_(nullptr), |
| 149 label_(nullptr), | 150 label_(nullptr), |
| 150 web_contents_(web_contents), | 151 web_contents_(web_contents), |
| 151 auto_close_(reason == AUTOMATIC), | 152 auto_close_(reason == AUTOMATIC), |
| 152 immersive_mode_controller_(immersive_mode_controller) { | 153 immersive_mode_controller_(immersive_mode_controller) { |
| 153 set_notify_enter_exit_on_child(true); | 154 set_notify_enter_exit_on_child(true); |
| 154 if (immersive_mode_controller_) | 155 if (immersive_mode_controller_) |
| 155 immersive_mode_controller_->AddObserver(this); | 156 immersive_mode_controller_->AddObserver(this); |
| 156 UseCompactMargins(); | 157 UseCompactMargins(); |
| 158 chrome::RecordDialogCreation(chrome::DialogIdentifier::ZOOM); |
| 157 } | 159 } |
| 158 | 160 |
| 159 ZoomBubbleView::~ZoomBubbleView() { | 161 ZoomBubbleView::~ZoomBubbleView() { |
| 160 if (immersive_mode_controller_) | 162 if (immersive_mode_controller_) |
| 161 immersive_mode_controller_->RemoveObserver(this); | 163 immersive_mode_controller_->RemoveObserver(this); |
| 162 } | 164 } |
| 163 | 165 |
| 164 void ZoomBubbleView::OnGestureEvent(ui::GestureEvent* event) { | 166 void ZoomBubbleView::OnGestureEvent(ui::GestureEvent* event) { |
| 165 if (!zoom_bubble_ || !zoom_bubble_->auto_close_ || | 167 if (!zoom_bubble_ || !zoom_bubble_->auto_close_ || |
| 166 event->type() != ui::ET_GESTURE_TAP) { | 168 event->type() != ui::ET_GESTURE_TAP) { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 } | 337 } |
| 336 } | 338 } |
| 337 | 339 |
| 338 void ZoomBubbleView::StopTimer() { | 340 void ZoomBubbleView::StopTimer() { |
| 339 timer_.Stop(); | 341 timer_.Stop(); |
| 340 } | 342 } |
| 341 | 343 |
| 342 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} | 344 ZoomBubbleView::ZoomBubbleExtensionInfo::ZoomBubbleExtensionInfo() {} |
| 343 | 345 |
| 344 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} | 346 ZoomBubbleView::ZoomBubbleExtensionInfo::~ZoomBubbleExtensionInfo() {} |
| OLD | NEW |