| 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/panels/panel.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 << id; | 372 << id; |
| 373 | 373 |
| 374 if (!GetWebContents()) | 374 if (!GetWebContents()) |
| 375 return; | 375 return; |
| 376 | 376 |
| 377 switch (id) { | 377 switch (id) { |
| 378 // Navigation | 378 // Navigation |
| 379 case IDC_RELOAD: | 379 case IDC_RELOAD: |
| 380 panel_host_->Reload(); | 380 panel_host_->Reload(); |
| 381 break; | 381 break; |
| 382 case IDC_RELOAD_IGNORING_CACHE: | 382 case IDC_RELOAD_BYPASSING_CACHE: |
| 383 panel_host_->ReloadIgnoringCache(); | 383 panel_host_->ReloadBypassingCache(); |
| 384 break; | 384 break; |
| 385 case IDC_STOP: | 385 case IDC_STOP: |
| 386 panel_host_->StopLoading(); | 386 panel_host_->StopLoading(); |
| 387 break; | 387 break; |
| 388 | 388 |
| 389 // Window management | 389 // Window management |
| 390 case IDC_CLOSE_WINDOW: | 390 case IDC_CLOSE_WINDOW: |
| 391 content::RecordAction(UserMetricsAction("CloseWindow")); | 391 content::RecordAction(UserMetricsAction("CloseWindow")); |
| 392 Close(); | 392 Close(); |
| 393 break; | 393 break; |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 content::NotificationService::NoDetails()); | 840 content::NotificationService::NoDetails()); |
| 841 } | 841 } |
| 842 | 842 |
| 843 void Panel::InitCommandState() { | 843 void Panel::InitCommandState() { |
| 844 // All supported commands whose state isn't set automagically some other way | 844 // All supported commands whose state isn't set automagically some other way |
| 845 // (like Stop during a page load) must have their state initialized here, | 845 // (like Stop during a page load) must have their state initialized here, |
| 846 // otherwise they will be forever disabled. | 846 // otherwise they will be forever disabled. |
| 847 | 847 |
| 848 // Navigation commands | 848 // Navigation commands |
| 849 command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); | 849 command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); |
| 850 command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); | 850 command_updater_.UpdateCommandEnabled(IDC_RELOAD_BYPASSING_CACHE, true); |
| 851 | 851 |
| 852 // Window management commands | 852 // Window management commands |
| 853 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); | 853 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); |
| 854 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | 854 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); |
| 855 | 855 |
| 856 // Zoom | 856 // Zoom |
| 857 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true); | 857 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MENU, true); |
| 858 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); | 858 command_updater_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); |
| 859 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); | 859 command_updater_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); |
| 860 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); | 860 command_updater_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 // static | 904 // static |
| 905 void Panel::FormatTitleForDisplay(base::string16* title) { | 905 void Panel::FormatTitleForDisplay(base::string16* title) { |
| 906 size_t current_index = 0; | 906 size_t current_index = 0; |
| 907 size_t match_index; | 907 size_t match_index; |
| 908 while ((match_index = title->find(L'\n', current_index)) != | 908 while ((match_index = title->find(L'\n', current_index)) != |
| 909 base::string16::npos) { | 909 base::string16::npos) { |
| 910 title->replace(match_index, 1, base::string16()); | 910 title->replace(match_index, 1, base::string16()); |
| 911 current_index = match_index; | 911 current_index = match_index; |
| 912 } | 912 } |
| 913 } | 913 } |
| OLD | NEW |