| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cmath> | 5 #include <cmath> |
| 6 | 6 |
| 7 #include "content/browser/host_zoom_map.h" | 7 #include "content/browser/host_zoom_map.h" |
| 8 | 8 |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 if (level && i == temporary_zoom_levels_.size()) { | 84 if (level && i == temporary_zoom_levels_.size()) { |
| 85 TemporaryZoomLevel temp; | 85 TemporaryZoomLevel temp; |
| 86 temp.render_process_id = render_process_id; | 86 temp.render_process_id = render_process_id; |
| 87 temp.render_view_id = render_view_id; | 87 temp.render_view_id = render_view_id; |
| 88 temp.zoom_level = level; | 88 temp.zoom_level = level; |
| 89 temporary_zoom_levels_.push_back(temp); | 89 temporary_zoom_levels_.push_back(temp); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 std::string host; |
| 93 NotificationService::current()->Notify(NotificationType::ZOOM_LEVEL_CHANGED, | 94 NotificationService::current()->Notify(NotificationType::ZOOM_LEVEL_CHANGED, |
| 94 Source<HostZoomMap>(this), | 95 Source<HostZoomMap>(this), |
| 95 NotificationService::NoDetails()); | 96 Details<const std::string>(&host)); |
| 97 |
| 96 } | 98 } |
| 97 | 99 |
| 98 void HostZoomMap::Observe( | 100 void HostZoomMap::Observe( |
| 99 NotificationType type, | 101 NotificationType type, |
| 100 const NotificationSource& source, | 102 const NotificationSource& source, |
| 101 const NotificationDetails& details) { | 103 const NotificationDetails& details) { |
| 102 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 104 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 103 | 105 |
| 104 switch (type.value) { | 106 switch (type.value) { |
| 105 case NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { | 107 case NotificationType::RENDER_VIEW_HOST_WILL_CLOSE_RENDER_VIEW: { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 116 } | 118 } |
| 117 break; | 119 break; |
| 118 } | 120 } |
| 119 default: | 121 default: |
| 120 NOTREACHED() << "Unexpected preference observed."; | 122 NOTREACHED() << "Unexpected preference observed."; |
| 121 } | 123 } |
| 122 } | 124 } |
| 123 | 125 |
| 124 HostZoomMap::~HostZoomMap() { | 126 HostZoomMap::~HostZoomMap() { |
| 125 } | 127 } |
| OLD | NEW |