Chromium Code Reviews

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 5440001: Enable to show the keyboard overlay by shortcut key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 1443 matching lines...)
1454 // visible at this point. Wait for next event cycle which toggles 1454 // visible at this point. Wait for next event cycle which toggles
1455 // the visibility of omnibox before creating new tab. 1455 // the visibility of omnibox before creating new tab.
1456 MessageLoop::current()->PostTask( 1456 MessageLoop::current()->PostTask(
1457 FROM_HERE, method_factory_.NewRunnableMethod(&Browser::Search)); 1457 FROM_HERE, method_factory_.NewRunnableMethod(&Browser::Search));
1458 return; 1458 return;
1459 } 1459 }
1460 1460
1461 // Otherwise just open it. 1461 // Otherwise just open it.
1462 NewTab(); 1462 NewTab();
1463 } 1463 }
1464
1465 void Browser::ShowKeyboardOverlay() {
1466 window_->ShowKeyboardOverlay(window_->GetNativeHandle());
1467 }
1464 #endif 1468 #endif
1465 1469
1466 void Browser::Exit() { 1470 void Browser::Exit() {
1467 UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_); 1471 UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_);
1468 #if defined(OS_CHROMEOS) 1472 #if defined(OS_CHROMEOS)
1469 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false); 1473 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutStarted", false);
1470 // Write /tmp/uptime-logout-started as well. 1474 // Write /tmp/uptime-logout-started as well.
1471 const char kLogoutStarted[] = "logout-started"; 1475 const char kLogoutStarted[] = "logout-started";
1472 chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted); 1476 chromeos::BootTimesLoader::Get()->RecordCurrentStats(kLogoutStarted);
1473 1477
(...skipping 648 matching lines...)
2122 case IDC_SELECT_LAST_TAB: SelectLastTab(); break; 2126 case IDC_SELECT_LAST_TAB: SelectLastTab(); break;
2123 case IDC_DUPLICATE_TAB: DuplicateTab(); break; 2127 case IDC_DUPLICATE_TAB: DuplicateTab(); break;
2124 case IDC_RESTORE_TAB: RestoreTab(); break; 2128 case IDC_RESTORE_TAB: RestoreTab(); break;
2125 case IDC_COPY_URL: WriteCurrentURLToClipboard(); break; 2129 case IDC_COPY_URL: WriteCurrentURLToClipboard(); break;
2126 case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break; 2130 case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break;
2127 case IDC_FULLSCREEN: ToggleFullscreenMode(); break; 2131 case IDC_FULLSCREEN: ToggleFullscreenMode(); break;
2128 case IDC_EXIT: Exit(); break; 2132 case IDC_EXIT: Exit(); break;
2129 case IDC_TOGGLE_VERTICAL_TABS: ToggleUseVerticalTabs(); break; 2133 case IDC_TOGGLE_VERTICAL_TABS: ToggleUseVerticalTabs(); break;
2130 #if defined(OS_CHROMEOS) 2134 #if defined(OS_CHROMEOS)
2131 case IDC_SEARCH: Search(); break; 2135 case IDC_SEARCH: Search(); break;
2136 case IDC_SHOW_KEYBOARD_OVERLAY: ShowKeyboardOverlay(); break;
2132 #endif 2137 #endif
2133 2138
2134 // Page-related commands 2139 // Page-related commands
2135 case IDC_SAVE_PAGE: SavePage(); break; 2140 case IDC_SAVE_PAGE: SavePage(); break;
2136 case IDC_BOOKMARK_PAGE: BookmarkCurrentPage(); break; 2141 case IDC_BOOKMARK_PAGE: BookmarkCurrentPage(); break;
2137 case IDC_BOOKMARK_ALL_TABS: BookmarkAllTabs(); break; 2142 case IDC_BOOKMARK_ALL_TABS: BookmarkAllTabs(); break;
2138 case IDC_VIEW_SOURCE: ViewSource(); break; 2143 case IDC_VIEW_SOURCE: ViewSource(); break;
2139 case IDC_EMAIL_PAGE_LOCATION: EmailPageLocation(); break; 2144 case IDC_EMAIL_PAGE_LOCATION: EmailPageLocation(); break;
2140 case IDC_PRINT: Print(); break; 2145 case IDC_PRINT: Print(); break;
2141 case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break; 2146 case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break;
(...skipping 1320 matching lines...)
3462 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); 3467 command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true);
3463 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); 3468 command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true);
3464 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, 3469 command_updater_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER,
3465 browser_defaults::bookmarks_enabled); 3470 browser_defaults::bookmarks_enabled);
3466 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); 3471 command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true);
3467 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); 3472 command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true);
3468 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); 3473 command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true);
3469 3474
3470 #if defined(OS_CHROMEOS) 3475 #if defined(OS_CHROMEOS)
3471 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true); 3476 command_updater_.UpdateCommandEnabled(IDC_SEARCH, true);
3477 command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true);
3472 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true); 3478 command_updater_.UpdateCommandEnabled(IDC_SYSTEM_OPTIONS, true);
3473 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true); 3479 command_updater_.UpdateCommandEnabled(IDC_INTERNET_OPTIONS, true);
3474 #endif 3480 #endif
3475 3481
3476 ExtensionsService* extensions_service = profile()->GetExtensionsService(); 3482 ExtensionsService* extensions_service = profile()->GetExtensionsService();
3477 bool enable_extensions = 3483 bool enable_extensions =
3478 extensions_service && extensions_service->extensions_enabled(); 3484 extensions_service && extensions_service->extensions_enabled();
3479 command_updater_.UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, 3485 command_updater_.UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS,
3480 enable_extensions); 3486 enable_extensions);
3481 3487
(...skipping 654 matching lines...)
4136 NOTREACHED(); 4142 NOTREACHED();
4137 return false; 4143 return false;
4138 } 4144 }
4139 4145
4140 void Browser::CreateInstantIfNecessary() { 4146 void Browser::CreateInstantIfNecessary() {
4141 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && 4147 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) &&
4142 !profile()->IsOffTheRecord()) { 4148 !profile()->IsOffTheRecord()) {
4143 instant_.reset(new InstantController(profile_, this)); 4149 instant_.reset(new InstantController(profile_, this));
4144 } 4150 }
4145 } 4151 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine