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 "components/ui/zoom/zoom_controller.h" | 5 #include "components/ui/zoom/zoom_controller.h" |
6 | 6 |
7 #include "components/ui/zoom/zoom_event_manager.h" | 7 #include "components/ui/zoom/zoom_event_manager.h" |
8 #include "components/ui/zoom/zoom_observer.h" | 8 #include "components/ui/zoom/zoom_observer.h" |
9 #include "content/public/browser/host_zoom_map.h" | 9 #include "content/public/browser/host_zoom_map.h" |
10 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 double old_zoom_level = zoom_level_; | 114 double old_zoom_level = zoom_level_; |
115 zoom_level_ = zoom_level; | 115 zoom_level_ = zoom_level; |
116 | 116 |
117 // TODO(wjmaclean) Do we care about filling in host/scheme here? | 117 // TODO(wjmaclean) Do we care about filling in host/scheme here? |
118 content::HostZoomMap::ZoomLevelChange change; | 118 content::HostZoomMap::ZoomLevelChange change; |
119 change.mode = content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM; | 119 change.mode = content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM; |
120 change.zoom_level = zoom_level; | 120 change.zoom_level = zoom_level; |
121 ZoomEventManager::GetForBrowserContext(browser_context_) | 121 ZoomEventManager::GetForBrowserContext(browser_context_) |
122 ->OnZoomLevelChanged(change); | 122 ->OnZoomLevelChanged(change); |
123 | 123 |
| 124 bool can_show_bubble = can_show_bubble_; |
| 125 if (client && client->ShouldSuppressBubble()) |
| 126 can_show_bubble = false; |
| 127 |
124 ZoomChangedEventData zoom_change_data(web_contents(), old_zoom_level, | 128 ZoomChangedEventData zoom_change_data(web_contents(), old_zoom_level, |
125 zoom_level_, zoom_mode_, | 129 zoom_level_, zoom_mode_, |
126 can_show_bubble_); | 130 can_show_bubble); |
127 FOR_EACH_OBSERVER(ZoomObserver, observers_, | 131 FOR_EACH_OBSERVER(ZoomObserver, observers_, |
128 OnZoomChanged(zoom_change_data)); | 132 OnZoomChanged(zoom_change_data)); |
129 | 133 |
130 last_client_ = NULL; | 134 last_client_ = NULL; |
131 return true; | 135 return true; |
132 } | 136 } |
133 | 137 |
134 content::HostZoomMap* zoom_map = | 138 content::HostZoomMap* zoom_map = |
135 content::HostZoomMap::GetForWebContents(web_contents()); | 139 content::HostZoomMap::GetForWebContents(web_contents()); |
136 DCHECK(zoom_map); | 140 DCHECK(zoom_map); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); | 367 int render_view_id = web_contents()->GetRenderViewHost()->GetRoutingID(); |
364 host_zoom_map_->SetPageScaleFactorIsOneForView( | 368 host_zoom_map_->SetPageScaleFactorIsOneForView( |
365 render_process_id, render_view_id, is_one); | 369 render_process_id, render_view_id, is_one); |
366 } | 370 } |
367 | 371 |
368 bool ZoomController::PageScaleFactorIsOne() const { | 372 bool ZoomController::PageScaleFactorIsOne() const { |
369 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); | 373 return content::HostZoomMap::PageScaleFactorIsOne(web_contents()); |
370 } | 374 } |
371 | 375 |
372 } // namespace ui_zoom | 376 } // namespace ui_zoom |
OLD | NEW |