OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 int TabContents::GetZoomPercent(bool* enable_increment, | 1498 int TabContents::GetZoomPercent(bool* enable_increment, |
1499 bool* enable_decrement) { | 1499 bool* enable_decrement) { |
1500 *enable_decrement = *enable_increment = false; | 1500 *enable_decrement = *enable_increment = false; |
1501 int percent = static_cast<int>( | 1501 int percent = static_cast<int>( |
1502 WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100); | 1502 WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100); |
1503 *enable_decrement = percent > minimum_zoom_percent_; | 1503 *enable_decrement = percent > minimum_zoom_percent_; |
1504 *enable_increment = percent < maximum_zoom_percent_; | 1504 *enable_increment = percent < maximum_zoom_percent_; |
1505 return percent; | 1505 return percent; |
1506 } | 1506 } |
1507 | 1507 |
| 1508 void TabContents::ViewSource() |
| 1509 { |
| 1510 if (delegate_) |
| 1511 delegate_->ViewSourceForTab(this); |
| 1512 } |
| 1513 |
1508 // Notifies the RenderWidgetHost instance about the fact that the page is | 1514 // Notifies the RenderWidgetHost instance about the fact that the page is |
1509 // loading, or done loading and calls the base implementation. | 1515 // loading, or done loading and calls the base implementation. |
1510 void TabContents::SetIsLoading(bool is_loading, | 1516 void TabContents::SetIsLoading(bool is_loading, |
1511 LoadNotificationDetails* details) { | 1517 LoadNotificationDetails* details) { |
1512 if (is_loading == is_loading_) | 1518 if (is_loading == is_loading_) |
1513 return; | 1519 return; |
1514 | 1520 |
1515 if (!is_loading) { | 1521 if (!is_loading) { |
1516 load_state_ = net::LOAD_STATE_IDLE; | 1522 load_state_ = net::LOAD_STATE_IDLE; |
1517 load_state_host_.clear(); | 1523 load_state_host_.clear(); |
(...skipping 1764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3282 } | 3288 } |
3283 | 3289 |
3284 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { | 3290 void TabContents::SwapInRenderViewHost(RenderViewHost* rvh) { |
3285 render_manager_.SwapInRenderViewHost(rvh); | 3291 render_manager_.SwapInRenderViewHost(rvh); |
3286 } | 3292 } |
3287 | 3293 |
3288 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 3294 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
3289 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); | 3295 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); |
3290 rwh_view->SetSize(view()->GetContainerSize()); | 3296 rwh_view->SetSize(view()->GetContainerSize()); |
3291 } | 3297 } |
OLD | NEW |