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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 case IDC_RELOAD: | 542 case IDC_RELOAD: |
543 panel_host_->Reload(); | 543 panel_host_->Reload(); |
544 break; | 544 break; |
545 case IDC_RELOAD_IGNORING_CACHE: | 545 case IDC_RELOAD_IGNORING_CACHE: |
546 panel_host_->ReloadIgnoringCache(); | 546 panel_host_->ReloadIgnoringCache(); |
547 break; | 547 break; |
548 case IDC_STOP: | 548 case IDC_STOP: |
549 panel_host_->StopLoading(); | 549 panel_host_->StopLoading(); |
550 break; | 550 break; |
551 | 551 |
| 552 // Window management |
| 553 case IDC_CLOSE_WINDOW: |
| 554 content::RecordAction(UserMetricsAction("CloseWindow")); |
| 555 Close(); |
| 556 break; |
| 557 case IDC_EXIT: |
| 558 content::RecordAction(UserMetricsAction("Exit")); |
| 559 browser::AttemptUserExit(); |
| 560 break; |
| 561 |
552 // Clipboard | 562 // Clipboard |
553 case IDC_COPY: | 563 case IDC_COPY: |
554 content::RecordAction(UserMetricsAction("Copy")); | 564 content::RecordAction(UserMetricsAction("Copy")); |
555 native_panel_->PanelCopy(); | 565 native_panel_->PanelCopy(); |
556 break; | 566 break; |
557 case IDC_CUT: | 567 case IDC_CUT: |
558 content::RecordAction(UserMetricsAction("Cut")); | 568 content::RecordAction(UserMetricsAction("Cut")); |
559 native_panel_->PanelCut(); | 569 native_panel_->PanelCut(); |
560 break; | 570 break; |
561 case IDC_PASTE: | 571 case IDC_PASTE: |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 | 758 |
749 void Panel::LoadingStateChanged(bool is_loading) { | 759 void Panel::LoadingStateChanged(bool is_loading) { |
750 command_updater_.UpdateCommandEnabled(IDC_STOP, is_loading); | 760 command_updater_.UpdateCommandEnabled(IDC_STOP, is_loading); |
751 native_panel_->UpdatePanelLoadingAnimations(is_loading); | 761 native_panel_->UpdatePanelLoadingAnimations(is_loading); |
752 UpdateTitleBar(); | 762 UpdateTitleBar(); |
753 } | 763 } |
754 | 764 |
755 void Panel::WebContentsFocused(content::WebContents* contents) { | 765 void Panel::WebContentsFocused(content::WebContents* contents) { |
756 native_panel_->PanelWebContentsFocused(contents); | 766 native_panel_->PanelWebContentsFocused(contents); |
757 } | 767 } |
OLD | NEW |