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

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

Issue 10914152: Fix the blocked pluigin infobar for metro mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « chrome/browser/plugin_infobar_delegates.cc ('k') | no next file » | 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) 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_command_controller.h" 5 #include "chrome/browser/ui/browser_command_controller.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/defaults.h" 9 #include "chrome/browser/defaults.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return true; 61 return true;
62 62
63 // If the |virtual_url()| isn't a chrome:// URL, check if it's actually 63 // If the |virtual_url()| isn't a chrome:// URL, check if it's actually
64 // view-source: of a chrome:// URL. 64 // view-source: of a chrome:// URL.
65 if (entry->GetVirtualURL().SchemeIs(chrome::kViewSourceScheme)) 65 if (entry->GetVirtualURL().SchemeIs(chrome::kViewSourceScheme))
66 return entry->GetURL().SchemeIs(chrome::kChromeUIScheme); 66 return entry->GetURL().SchemeIs(chrome::kChromeUIScheme);
67 67
68 return false; 68 return false;
69 } 69 }
70 70
71 #if defined(OS_WIN)
72 void RestartWithModeSwitch() {
73 PrefService* prefs = g_browser_process->local_state();
74 if (!prefs)
75 return;
76 if (!prefs->HasPrefPath(prefs::kRestartSwitchMode))
77 return;
78 prefs->SetBoolean(prefs::kRestartSwitchMode, true);
79 browser::AttemptRestart();
80 }
81 #endif
82
83 } // namespace 71 } // namespace
84 72
85 namespace chrome { 73 namespace chrome {
86 74
87 /////////////////////////////////////////////////////////////////////////////// 75 ///////////////////////////////////////////////////////////////////////////////
88 // BrowserCommandController, public: 76 // BrowserCommandController, public:
89 77
90 BrowserCommandController::BrowserCommandController(Browser* browser) 78 BrowserCommandController::BrowserCommandController(Browser* browser)
91 : browser_(browser), 79 : browser_(browser),
92 ALLOW_THIS_IN_INITIALIZER_LIST(command_updater_(this)), 80 ALLOW_THIS_IN_INITIALIZER_LIST(command_updater_(this)),
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 333
346 #if defined(OS_WIN) 334 #if defined(OS_WIN)
347 // Windows 8 specific commands. 335 // Windows 8 specific commands.
348 case IDC_METRO_SNAP_ENABLE: 336 case IDC_METRO_SNAP_ENABLE:
349 browser_->SetMetroSnapMode(true); 337 browser_->SetMetroSnapMode(true);
350 break; 338 break;
351 case IDC_METRO_SNAP_DISABLE: 339 case IDC_METRO_SNAP_DISABLE:
352 browser_->SetMetroSnapMode(false); 340 browser_->SetMetroSnapMode(false);
353 break; 341 break;
354 case IDC_WIN8_DESKTOP_RESTART: 342 case IDC_WIN8_DESKTOP_RESTART:
355 RestartWithModeSwitch();
356 break;
357 case IDC_WIN8_METRO_RESTART: 343 case IDC_WIN8_METRO_RESTART:
358 RestartWithModeSwitch(); 344 browser::AttemptRestartWithModeSwitch();
359 break; 345 break;
360 #endif 346 #endif
361 347
362 #if defined(OS_MACOSX) 348 #if defined(OS_MACOSX)
363 case IDC_PRESENTATION_MODE: 349 case IDC_PRESENTATION_MODE:
364 browser_->TogglePresentationMode(); 350 browser_->TogglePresentationMode();
365 break; 351 break;
366 #endif 352 #endif
367 case IDC_EXIT: 353 case IDC_EXIT:
368 Exit(); 354 Exit();
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 1088
1103 BrowserWindow* BrowserCommandController::window() { 1089 BrowserWindow* BrowserCommandController::window() {
1104 return browser_->window(); 1090 return browser_->window();
1105 } 1091 }
1106 1092
1107 Profile* BrowserCommandController::profile() { 1093 Profile* BrowserCommandController::profile() {
1108 return browser_->profile(); 1094 return browser_->profile();
1109 } 1095 }
1110 1096
1111 } // namespace chrome 1097 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/plugin_infobar_delegates.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698