Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

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

Issue 9297008: [HTerm-Crosh] Add key shortcut for opening Crosh on ChromeOS Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review.. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 #endif // OS_WIN 193 #endif // OS_WIN
194 194
195 #if defined(OS_MACOSX) 195 #if defined(OS_MACOSX)
196 #include "content/browser/find_pasteboard.h" 196 #include "content/browser/find_pasteboard.h"
197 #endif 197 #endif
198 198
199 #if defined(OS_CHROMEOS) 199 #if defined(OS_CHROMEOS)
200 #include "chrome/browser/chromeos/boot_times_loader.h" 200 #include "chrome/browser/chromeos/boot_times_loader.h"
201 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" 201 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
202 #include "chrome/browser/chromeos/dbus/power_manager_client.h" 202 #include "chrome/browser/chromeos/dbus/power_manager_client.h"
203 #if defined(USE_AURA)
204 #include "chrome/browser/extensions/api/terminal/terminal_extension_helper.h"
205 #endif
203 #include "chrome/browser/ui/webui/active_downloads_ui.h" 206 #include "chrome/browser/ui/webui/active_downloads_ui.h"
204 #endif 207 #endif
205 208
206 #if defined(USE_AURA) 209 #if defined(USE_AURA)
207 #include "ash/shell.h" 210 #include "ash/shell.h"
208 #endif 211 #endif
209 212
210 #if !defined(OS_CHROMEOS) || defined(USE_AURA) 213 #if !defined(OS_CHROMEOS) || defined(USE_AURA)
211 #include "chrome/browser/download/download_shelf.h" 214 #include "chrome/browser/download/download_shelf.h"
212 #endif 215 #endif
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after
2399 window_->ShowMobileSetup(); 2402 window_->ShowMobileSetup();
2400 } else { 2403 } else {
2401 OpenURL(OpenURLParams( 2404 OpenURL(OpenURLParams(
2402 GURL(chrome::kChromeUIMobileSetupURL), Referrer(), NEW_FOREGROUND_TAB, 2405 GURL(chrome::kChromeUIMobileSetupURL), Referrer(), NEW_FOREGROUND_TAB,
2403 content::PAGE_TRANSITION_LINK, false)); 2406 content::PAGE_TRANSITION_LINK, false));
2404 window_->Activate(); 2407 window_->Activate();
2405 } 2408 }
2406 } 2409 }
2407 #endif 2410 #endif
2408 2411
2412 #if defined(OS_CHROMEOS) && defined(USE_AURA)
2413 void Browser::OpenCrosh() {
2414 GURL crosh_url = TerminalExtensionHelper::GetCroshExtensionURL(profile_);
2415 if (!crosh_url.is_valid())
2416 return;
2417 OpenURL(OpenURLParams(crosh_url, Referrer(), NEW_FOREGROUND_TAB,
2418 content::PAGE_TRANSITION_GENERATED,
2419 false));
2420 }
2421 #endif
2422
2409 void Browser::OpenPluginsTabAndActivate() { 2423 void Browser::OpenPluginsTabAndActivate() {
2410 OpenURL(OpenURLParams( 2424 OpenURL(OpenURLParams(
2411 GURL(chrome::kChromeUIPluginsURL), Referrer(), NEW_FOREGROUND_TAB, 2425 GURL(chrome::kChromeUIPluginsURL), Referrer(), NEW_FOREGROUND_TAB,
2412 content::PAGE_TRANSITION_LINK, false)); 2426 content::PAGE_TRANSITION_LINK, false));
2413 window_->Activate(); 2427 window_->Activate();
2414 } 2428 }
2415 2429
2416 /////////////////////////////////////////////////////////////////////////////// 2430 ///////////////////////////////////////////////////////////////////////////////
2417 2431
2418 // static 2432 // static
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break; 3015 case IDC_VIEW_INCOMPATIBILITIES: ShowAboutConflictsTab(); break;
3002 case IDC_HELP_PAGE: ShowHelpTab(); break; 3016 case IDC_HELP_PAGE: ShowHelpTab(); break;
3003 #if defined(OS_CHROMEOS) 3017 #if defined(OS_CHROMEOS)
3004 case IDC_LOCK_SCREEN: LockScreen(); break; 3018 case IDC_LOCK_SCREEN: LockScreen(); break;
3005 case IDC_SHUTDOWN: Shutdown(); break; 3019 case IDC_SHUTDOWN: Shutdown(); break;
3006 case IDC_FILE_MANAGER: OpenFileManager(); break; 3020 case IDC_FILE_MANAGER: OpenFileManager(); break;
3007 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break; 3021 case IDC_SYSTEM_OPTIONS: OpenSystemOptionsDialog(); break;
3008 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break; 3022 case IDC_INTERNET_OPTIONS: OpenInternetOptionsDialog(); break;
3009 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break; 3023 case IDC_LANGUAGE_OPTIONS: OpenLanguageOptionsDialog(); break;
3010 #endif 3024 #endif
3025 #if defined(OS_CHROMEOS) && defined(USE_AURA)
3026 case IDC_NEW_CROSH_TAB: OpenCrosh(); break;
3027 #endif
3011 case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break; 3028 case IDC_SHOW_SYNC_SETUP: ShowSyncSetup(); break;
3012 case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break; 3029 case IDC_TOGGLE_SPEECH_INPUT: ToggleSpeechInput(); break;
3013 3030
3014 default: 3031 default:
3015 LOG(WARNING) << "Received Unimplemented Command: " << id; 3032 LOG(WARNING) << "Received Unimplemented Command: " << id;
3016 break; 3033 break;
3017 } 3034 }
3018 } 3035 }
3019 3036
3020 void Browser::ExecuteCommand(int id, int event_flags) { 3037 void Browser::ExecuteCommand(int id, int event_flags) {
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
4496 // (like Back & Forward with initial page load) must have their state 4513 // (like Back & Forward with initial page load) must have their state
4497 // initialized here, otherwise they will be forever disabled. 4514 // initialized here, otherwise they will be forever disabled.
4498 4515
4499 // Navigation commands 4516 // Navigation commands
4500 command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); 4517 command_updater_.UpdateCommandEnabled(IDC_RELOAD, true);
4501 command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true); 4518 command_updater_.UpdateCommandEnabled(IDC_RELOAD_IGNORING_CACHE, true);
4502 4519
4503 // Window management commands 4520 // Window management commands
4504 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); 4521 command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
4505 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); 4522 command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true);
4523 #if defined(OS_CHROMEOS) && defined(USE_AURA)
4524 command_updater_.UpdateCommandEnabled(IDC_NEW_CROSH_TAB, true);
4525 #endif
4506 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); 4526 command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true);
4507 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); 4527 command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true);
4508 command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, false); 4528 command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, false);
4509 command_updater_.UpdateCommandEnabled(IDC_EXIT, true); 4529 command_updater_.UpdateCommandEnabled(IDC_EXIT, true);
4510 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); 4530 command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true);
4511 4531
4512 // Page-related commands 4532 // Page-related commands
4513 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true); 4533 command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, true);
4514 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); 4534 command_updater_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true);
4515 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); 4535 command_updater_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true);
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
5523 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); 5543 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false);
5524 window_->GetLocationBar()->ShowFirstRunBubble(); 5544 window_->GetLocationBar()->ShowFirstRunBubble();
5525 } else { 5545 } else {
5526 GlobalErrorService* service = 5546 GlobalErrorService* service =
5527 GlobalErrorServiceFactory::GetForProfile(profile()); 5547 GlobalErrorServiceFactory::GetForProfile(profile());
5528 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5548 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5529 if (error) 5549 if (error)
5530 error->ShowBubbleView(this); 5550 error->ShowBubbleView(this);
5531 } 5551 }
5532 } 5552 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698