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/toolbar/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (browser_->profile()->IsManaged()) | 473 if (browser_->profile()->IsManaged()) |
474 return false; | 474 return false; |
475 | 475 |
476 #if defined(OS_WIN) | 476 #if defined(OS_WIN) |
477 if (win8::IsSingleWindowMetroMode() && | 477 if (win8::IsSingleWindowMetroMode() && |
478 browser_->profile()->HasOffTheRecordProfile()) { | 478 browser_->profile()->HasOffTheRecordProfile()) { |
479 return false; | 479 return false; |
480 } | 480 } |
481 #endif | 481 #endif |
482 | 482 |
483 #if defined(OS_CHROMEOS) | 483 return !browser_->profile()->IsGuestSession(); |
484 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
485 chromeos::switches::kGuestSession)) { | |
486 return false; | |
487 } | |
488 #endif | |
489 | |
490 return true; | |
491 } | 484 } |
492 | 485 |
493 bool WrenchMenuModel::ShouldShowNewWindowMenuItem() { | 486 bool WrenchMenuModel::ShouldShowNewWindowMenuItem() { |
494 #if defined(OS_WIN) | 487 #if defined(OS_WIN) |
495 if (!win8::IsSingleWindowMetroMode()) | 488 if (!win8::IsSingleWindowMetroMode()) |
496 return true; | 489 return true; |
497 | 490 |
498 // In Win8's single window Metro mode, we only show the New Window options | 491 // In Win8's single window Metro mode, we only show the New Window options |
499 // if there isn't already a window of the requested type (incognito or not) | 492 // if there isn't already a window of the requested type (incognito or not) |
500 // that is available. | 493 // that is available. |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 &enable_increment, &enable_decrement); | 776 &enable_increment, &enable_decrement); |
784 } | 777 } |
785 zoom_label_ = l10n_util::GetStringFUTF16( | 778 zoom_label_ = l10n_util::GetStringFUTF16( |
786 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 779 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
787 } | 780 } |
788 | 781 |
789 void WrenchMenuModel::OnZoomLevelChanged( | 782 void WrenchMenuModel::OnZoomLevelChanged( |
790 const content::HostZoomMap::ZoomLevelChange& change) { | 783 const content::HostZoomMap::ZoomLevelChange& change) { |
791 UpdateZoomControls(); | 784 UpdateZoomControls(); |
792 } | 785 } |
OLD | NEW |