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/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 case IDC_ZOOM_NORMAL: | 408 case IDC_ZOOM_NORMAL: |
409 panel_host_->Zoom(content::PAGE_ZOOM_RESET); | 409 panel_host_->Zoom(content::PAGE_ZOOM_RESET); |
410 break; | 410 break; |
411 case IDC_ZOOM_MINUS: | 411 case IDC_ZOOM_MINUS: |
412 panel_host_->Zoom(content::PAGE_ZOOM_OUT); | 412 panel_host_->Zoom(content::PAGE_ZOOM_OUT); |
413 break; | 413 break; |
414 | 414 |
415 // DevTools | 415 // DevTools |
416 case IDC_DEV_TOOLS: | 416 case IDC_DEV_TOOLS: |
417 content::RecordAction(UserMetricsAction("DevTools_ToggleWindow")); | 417 content::RecordAction(UserMetricsAction("DevTools_ToggleWindow")); |
418 DevToolsWindow::OpenDevToolsWindow( | 418 DevToolsWindow::OpenDevToolsWindow(GetWebContents(), |
419 GetWebContents()->GetRenderViewHost(), | 419 DevToolsToggleAction::Show()); |
420 DevToolsToggleAction::Show()); | |
421 break; | 420 break; |
422 case IDC_DEV_TOOLS_CONSOLE: | 421 case IDC_DEV_TOOLS_CONSOLE: |
423 content::RecordAction(UserMetricsAction("DevTools_ToggleConsole")); | 422 content::RecordAction(UserMetricsAction("DevTools_ToggleConsole")); |
424 DevToolsWindow::OpenDevToolsWindow( | 423 DevToolsWindow::OpenDevToolsWindow(GetWebContents(), |
425 GetWebContents()->GetRenderViewHost(), | 424 DevToolsToggleAction::ShowConsole()); |
426 DevToolsToggleAction::ShowConsole()); | |
427 break; | 425 break; |
428 | 426 |
429 default: | 427 default: |
430 LOG(WARNING) << "Received unimplemented command: " << id; | 428 LOG(WARNING) << "Received unimplemented command: " << id; |
431 break; | 429 break; |
432 } | 430 } |
433 } | 431 } |
434 | 432 |
435 void Panel::Observe(int type, | 433 void Panel::Observe(int type, |
436 const content::NotificationSource& source, | 434 const content::NotificationSource& source, |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 // static | 893 // static |
896 void Panel::FormatTitleForDisplay(base::string16* title) { | 894 void Panel::FormatTitleForDisplay(base::string16* title) { |
897 size_t current_index = 0; | 895 size_t current_index = 0; |
898 size_t match_index; | 896 size_t match_index; |
899 while ((match_index = title->find(L'\n', current_index)) != | 897 while ((match_index = title->find(L'\n', current_index)) != |
900 base::string16::npos) { | 898 base::string16::npos) { |
901 title->replace(match_index, 1, base::string16()); | 899 title->replace(match_index, 1, base::string16()); |
902 current_index = match_index; | 900 current_index = match_index; |
903 } | 901 } |
904 } | 902 } |
OLD | NEW |