Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 302603012: Zoom Extension API (content changes) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comments re GURL vs host/scheme use. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/public/browser/host_zoom_map.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 WebView* webview = render_view->GetWebView(); 189 WebView* webview = render_view->GetWebView();
190 WebDocument document = webview->mainFrame()->document(); 190 WebDocument document = webview->mainFrame()->document();
191 191
192 // Don't set zoom level for full-page plugin since they don't use the same 192 // Don't set zoom level for full-page plugin since they don't use the same
193 // zoom settings. 193 // zoom settings.
194 if (document.isPluginDocument()) 194 if (document.isPluginDocument())
195 return true; 195 return true;
196 GURL url(document.url()); 196 GURL url(document.url());
197 // Empty scheme works as wildcard that matches any scheme, 197 // Empty scheme works as wildcard that matches any scheme,
198 if ((net::GetHostOrSpecFromURL(url) == host_) && 198 if ((net::GetHostOrSpecFromURL(url) == host_) &&
199 (scheme_.empty() || scheme_ == url.scheme())) { 199 (scheme_.empty() || scheme_ == url.scheme()) &&
200 !static_cast<RenderViewImpl*>(render_view)
201 ->uses_temporary_zoom_level()) {
200 webview->hidePopups(); 202 webview->hidePopups();
201 webview->setZoomLevel(zoom_level_); 203 webview->setZoomLevel(zoom_level_);
202 } 204 }
203 return true; 205 return true;
204 } 206 }
205 207
206 private: 208 private:
207 const std::string scheme_; 209 const std::string scheme_;
208 const std::string host_; 210 const std::string host_;
209 const double zoom_level_; 211 const double zoom_level_;
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 hidden_widget_count_--; 1515 hidden_widget_count_--;
1514 1516
1515 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) { 1517 if (!GetContentClient()->renderer()->RunIdleHandlerWhenWidgetsHidden()) {
1516 return; 1518 return;
1517 } 1519 }
1518 1520
1519 ScheduleIdleHandler(kLongIdleHandlerDelayMs); 1521 ScheduleIdleHandler(kLongIdleHandlerDelayMs);
1520 } 1522 }
1521 1523
1522 } // namespace content 1524 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/host_zoom_map.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698