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