Skip to content

Commit

Permalink
Eliminate ash::internal namespace
Browse files Browse the repository at this point in the history
Plus obvious style nit fixes.

BUG=None
TBR=sky@chromium.org

Review URL: https://codereview.chromium.org/224113005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261522 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
oshima@chromium.org committed Apr 3, 2014
1 parent e95d6cd commit 093b8d6
Show file tree
Hide file tree
Showing 500 changed files with 1,529 additions and 2,782 deletions.
34 changes: 15 additions & 19 deletions ash/accelerators/accelerator_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ namespace ash {
namespace {

using base::UserMetricsAction;
using internal::DisplayInfo;

bool DebugShortcutsEnabled() {
#if defined(NDEBUG)
Expand Down Expand Up @@ -292,12 +291,12 @@ bool HandleRotatePaneFocus(Shell::Direction direction) {
// TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE.
case Shell::FORWARD: {
base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane"));
shell->focus_cycler()->RotateFocus(internal::FocusCycler::FORWARD);
shell->focus_cycler()->RotateFocus(FocusCycler::FORWARD);
break;
}
case Shell::BACKWARD: {
base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane"));
shell->focus_cycler()->RotateFocus(internal::FocusCycler::BACKWARD);
shell->focus_cycler()->RotateFocus(FocusCycler::BACKWARD);
break;
}
}
Expand Down Expand Up @@ -350,8 +349,7 @@ bool HandleRotateScreen() {
}

bool HandleScaleReset() {
internal::DisplayManager* display_manager =
Shell::GetInstance()->display_manager();
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
int64 display_id = display_manager->GetDisplayIdForUIScaling();
if (display_id == gfx::Display::kInvalidDisplayID)
return false;
Expand All @@ -363,8 +361,7 @@ bool HandleScaleReset() {
}

bool HandleScaleUI(bool up) {
internal::DisplayManager* display_manager =
Shell::GetInstance()->display_manager();
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
int64 display_id = display_manager->GetDisplayIdForUIScaling();
if (display_id == gfx::Display::kInvalidDisplayID)
return false;
Expand All @@ -376,8 +373,7 @@ bool HandleScaleUI(bool up) {
}

const DisplayInfo& display_info = display_manager->GetDisplayInfo(display_id);
float next_scale =
internal::DisplayManager::GetNextUIScale(display_info, up);
float next_scale = DisplayManager::GetNextUIScale(display_info, up);
display_manager->SetDisplayUIScale(display_id, next_scale);
return true;
}
Expand All @@ -399,10 +395,10 @@ bool HandleShowKeyboardOverlay() {

void HandleShowMessageCenterBubble() {
base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble"));
internal::RootWindowController* controller =
internal::RootWindowController::ForTargetRootWindow();
internal::StatusAreaWidget* status_area_widget =
controller->shelf()->status_area_widget();
RootWindowController* controller =
RootWindowController::ForTargetRootWindow();
StatusAreaWidget* status_area_widget =
controller->shelf()->status_area_widget();
if (status_area_widget) {
WebNotificationTray* notification_tray =
status_area_widget->web_notification_tray();
Expand All @@ -413,8 +409,8 @@ void HandleShowMessageCenterBubble() {

bool HandleShowSystemTrayBubble() {
base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble"));
internal::RootWindowController* controller =
internal::RootWindowController::ForTargetRootWindow();
RootWindowController* controller =
RootWindowController::ForTargetRootWindow();
if (!controller->GetSystemTray()->HasSystemBubble()) {
controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW);
return true;
Expand Down Expand Up @@ -608,8 +604,8 @@ bool HandleToggleTouchViewTesting() {
}

bool HandleTouchHudClear() {
internal::RootWindowController* controller =
internal::RootWindowController::ForTargetRootWindow();
RootWindowController* controller =
RootWindowController::ForTargetRootWindow();
if (controller->touch_hud_debug()) {
controller->touch_hud_debug()->Clear();
return true;
Expand All @@ -618,8 +614,8 @@ bool HandleTouchHudClear() {
}

bool HandleTouchHudModeChange() {
internal::RootWindowController* controller =
internal::RootWindowController::ForTargetRootWindow();
RootWindowController* controller =
RootWindowController::ForTargetRootWindow();
if (controller->touch_hud_debug()) {
controller->touch_hud_debug()->ChangeToNextMode();
return true;
Expand Down
4 changes: 2 additions & 2 deletions ash/accelerators/accelerator_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,12 @@ TEST_F(AcceleratorControllerTest, CenterWindowAccelerator) {
// Add the window to docked container and try to center it.
window->SetBounds(gfx::Rect(0, 0, 20, 20));
aura::Window* docked_container = Shell::GetContainer(
window->GetRootWindow(), internal::kShellWindowId_DockedContainer);
window->GetRootWindow(), kShellWindowId_DockedContainer);
docked_container->AddChild(window.get());
gfx::Rect docked_bounds = window->GetBoundsInScreen();
GetController()->PerformAction(WINDOW_POSITION_CENTER, dummy);
// It should not get centered and should remain docked.
EXPECT_EQ(internal::kShellWindowId_DockedContainer, window->parent()->id());
EXPECT_EQ(kShellWindowId_DockedContainer, window->parent()->id());
EXPECT_EQ(docked_bounds.ToString(), window->GetBoundsInScreen().ToString());
}

Expand Down
3 changes: 0 additions & 3 deletions ash/accelerators/accelerator_filter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ bool ShouldProcessAcceleratorsNow(const ui::Accelerator& accelerator,

} // namespace

namespace internal {

////////////////////////////////////////////////////////////////////////////////
// AcceleratorFilter, public:

Expand Down Expand Up @@ -133,5 +131,4 @@ void AcceleratorFilter::OnKeyEvent(ui::KeyEvent* event) {
event->StopPropagation();
}

} // namespace internal
} // namespace ash
2 changes: 0 additions & 2 deletions ash/accelerators/accelerator_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "ui/events/event_handler.h"

namespace ash {
namespace internal {

// AcceleratorFilter filters key events for AcceleratorControler handling global
// keyboard accelerators.
Expand All @@ -27,7 +26,6 @@ class ASH_EXPORT AcceleratorFilter : public ui::EventHandler {
DISALLOW_COPY_AND_ASSIGN(AcceleratorFilter);
};

} // namespace internal
} // namespace ash

#endif // ASH_ACCELERATORS_ACCELERATOR_FILTER_H_
2 changes: 1 addition & 1 deletion ash/accelerators/accelerator_filter_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TEST_F(AcceleratorFilterTest, TestCapsLockMask) {
// Tests if special hardware keys like brightness and volume are consumed as
// expected by the shell.
TEST_F(AcceleratorFilterTest, CanConsumeSystemKeys) {
internal::AcceleratorFilter filter;
AcceleratorFilter filter;

// Normal keys are not consumed.
ui::KeyEvent press_a(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
Expand Down
5 changes: 2 additions & 3 deletions ash/accelerators/exit_warning_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,8 @@ void ExitWarningHandler::Show() {
params.remove_standard_frame = true;
params.delegate = delegate;
params.bounds = bounds;
params.parent = Shell::GetContainer(
root_window,
internal::kShellWindowId_SettingBubbleContainer);
params.parent =
Shell::GetContainer(root_window, kShellWindowId_SettingBubbleContainer);
widget_.reset(new views::Widget);
widget_->Init(params);
widget_->SetContentsView(delegate);
Expand Down
2 changes: 0 additions & 2 deletions ash/default_accessibility_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <limits>

namespace ash {
namespace internal {

DefaultAccessibilityDelegate::DefaultAccessibilityDelegate()
: spoken_feedback_enabled_(false),
Expand Down Expand Up @@ -115,5 +114,4 @@ base::TimeDelta DefaultAccessibilityDelegate::PlayShutdownSound() const {
return base::TimeDelta();
}

} // namespace internal
} // namespace ash
2 changes: 0 additions & 2 deletions ash/default_accessibility_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "base/compiler_specific.h"

namespace ash {
namespace internal {

class ASH_EXPORT DefaultAccessibilityDelegate : public AccessibilityDelegate {
public:
Expand Down Expand Up @@ -54,7 +53,6 @@ class ASH_EXPORT DefaultAccessibilityDelegate : public AccessibilityDelegate {
DISALLOW_COPY_AND_ASSIGN(DefaultAccessibilityDelegate);
};

} // namespace internal
} // namespace ash

#endif // DEFAULT_ACCESSIBILITY_DELEGATE_H_
25 changes: 11 additions & 14 deletions ash/desktop_background/desktop_background_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "ui/gfx/rect.h"
#include "ui/views/widget/widget.h"

using ash::internal::DesktopBackgroundWidgetController;
using content::BrowserThread;

namespace ash {
Expand Down Expand Up @@ -370,25 +369,24 @@ void DesktopBackgroundController::OnDefaultWallpaperLoadCompleted(

void DesktopBackgroundController::InstallDesktopController(
aura::Window* root_window) {
internal::DesktopBackgroundWidgetController* component = NULL;
DesktopBackgroundWidgetController* component = NULL;
int container_id = GetBackgroundContainerId(locked_);

switch (desktop_background_mode_) {
case BACKGROUND_IMAGE: {
views::Widget* widget = internal::CreateDesktopBackground(root_window,
container_id);
component = new internal::DesktopBackgroundWidgetController(widget);
views::Widget* widget =
CreateDesktopBackground(root_window, container_id);
component = new DesktopBackgroundWidgetController(widget);
break;
}
case BACKGROUND_NONE:
NOTREACHED();
return;
}
internal::GetRootWindowController(root_window)->
SetAnimatingWallpaperController(
new internal::AnimatingDesktopController(component));
GetRootWindowController(root_window)->SetAnimatingWallpaperController(
new AnimatingDesktopController(component));

component->StartAnimating(internal::GetRootWindowController(root_window));
component->StartAnimating(GetRootWindowController(root_window));
}

void DesktopBackgroundController::InstallDesktopControllerForAllWindows() {
Expand All @@ -407,7 +405,7 @@ bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
Shell::GetAllRootWindowControllers();
for (Shell::RootWindowControllerList::iterator iter = controllers.begin();
iter != controllers.end(); ++iter) {
internal::RootWindowController* root_window_controller = *iter;
RootWindowController* root_window_controller = *iter;
// In the steady state (no animation playing) the background widget
// controller exists in the RootWindowController.
DesktopBackgroundWidgetController* desktop_controller =
Expand Down Expand Up @@ -439,8 +437,8 @@ bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
}

int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
return locked ? internal::kShellWindowId_LockScreenBackgroundContainer :
internal::kShellWindowId_DesktopBackgroundContainer;
return locked ? kShellWindowId_LockScreenBackgroundContainer
: kShellWindowId_DesktopBackgroundContainer;
}

void DesktopBackgroundController::UpdateWallpaper() {
Expand All @@ -456,8 +454,7 @@ gfx::Size DesktopBackgroundController::GetMaxDisplaySizeInNative() {
int width = 0;
int height = 0;
std::vector<gfx::Display> displays = Shell::GetScreen()->GetAllDisplays();
internal::DisplayManager* display_manager =
Shell::GetInstance()->display_manager();
DisplayManager* display_manager = Shell::GetInstance()->display_manager();

for (std::vector<gfx::Display>::iterator iter = displays.begin();
iter != displays.end(); ++iter) {
Expand Down
26 changes: 13 additions & 13 deletions ash/desktop_background/desktop_background_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ namespace ash {
namespace {

// Containers IDs used for tests.
const int kDesktopBackgroundId =
ash::internal::kShellWindowId_DesktopBackgroundContainer;
const int kDesktopBackgroundId = ash::kShellWindowId_DesktopBackgroundContainer;
const int kLockScreenBackgroundId =
ash::internal::kShellWindowId_LockScreenBackgroundContainer;
ash::kShellWindowId_LockScreenBackgroundContainer;

// Returns number of child windows in a shell window container.
int ChildCountForContainer(int container_id) {
Expand Down Expand Up @@ -111,7 +110,7 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
test::AshTestBase::SetUp();
// Ash shell initialization creates wallpaper. Reset it so we can manually
// control wallpaper creation and animation in our tests.
internal::RootWindowController* root_window_controller =
RootWindowController* root_window_controller =
Shell::GetPrimaryRootWindowController();
root_window_controller->SetWallpaperController(NULL);
root_window_controller->SetAnimatingWallpaperController(NULL);
Expand Down Expand Up @@ -151,9 +150,10 @@ class DesktopBackgroundControllerTest : public test::AshTestBase {
// Runs kAnimatingDesktopController's animation to completion.
// TODO(bshe): Don't require tests to run animations; it's slow.
void RunDesktopControllerAnimation() {
internal::DesktopBackgroundWidgetController* controller =
Shell::GetPrimaryRootWindowController()->
animating_wallpaper_controller()->GetController(false);
DesktopBackgroundWidgetController* controller =
Shell::GetPrimaryRootWindowController()
->animating_wallpaper_controller()
->GetController(false);
ASSERT_NO_FATAL_FAILURE(RunAnimationForWidget(controller->widget()));
}

Expand Down Expand Up @@ -321,7 +321,7 @@ TEST_F(DesktopBackgroundControllerTest, ControllerOwnership) {

// The new wallpaper is ready to start animating. kAnimatingDesktopController
// holds the widget controller instance. kDesktopController will get it later.
internal::RootWindowController* root_window_controller =
RootWindowController* root_window_controller =
Shell::GetPrimaryRootWindowController();
EXPECT_TRUE(root_window_controller->animating_wallpaper_controller()->
GetController(false));
Expand Down Expand Up @@ -363,7 +363,7 @@ TEST_F(DesktopBackgroundControllerTest, BackgroundMovementDuringUnlock) {

// In this state we have two desktop background views stored in different
// properties. Both are in the lock screen background container.
internal::RootWindowController* root_window_controller =
RootWindowController* root_window_controller =
Shell::GetPrimaryRootWindowController();
EXPECT_TRUE(root_window_controller->animating_wallpaper_controller()->
GetController(false));
Expand Down Expand Up @@ -405,11 +405,11 @@ TEST_F(DesktopBackgroundControllerTest, ChangeWallpaperQuick) {
// Change to a new wallpaper.
controller->CreateEmptyWallpaper();

internal::RootWindowController* root_window_controller =
RootWindowController* root_window_controller =
Shell::GetPrimaryRootWindowController();
internal::DesktopBackgroundWidgetController* animating_controller =
root_window_controller->animating_wallpaper_controller()->
GetController(false);
DesktopBackgroundWidgetController* animating_controller =
root_window_controller->animating_wallpaper_controller()->GetController(
false);
EXPECT_TRUE(animating_controller);
EXPECT_TRUE(root_window_controller->wallpaper_controller());

Expand Down
2 changes: 0 additions & 2 deletions ash/desktop_background/desktop_background_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "ui/views/widget/widget.h"

namespace ash {
namespace internal {
namespace {

// For our scaling ratios we need to round positive numbers.
Expand Down Expand Up @@ -224,5 +223,4 @@ views::Widget* CreateDesktopBackground(aura::Window* root_window,
return desktop_widget;
}

} // namespace internal
} // namespace ash
2 changes: 0 additions & 2 deletions ash/desktop_background/desktop_background_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "ui/views/view.h"

namespace ash {
namespace internal {

class DesktopBackgroundView : public views::View,
public views::ContextMenuController {
Expand All @@ -31,7 +30,6 @@ class DesktopBackgroundView : public views::View,
DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundView);
};

} // namespace internal
} // namespace ash

#endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_VIEW_H_
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "ui/views/widget/widget_observer.h"

namespace ash {
namespace internal {
namespace {

class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver,
Expand Down Expand Up @@ -144,5 +143,4 @@ DesktopBackgroundWidgetController* AnimatingDesktopController::GetController(
return controller_.get();
}

} // namespace internal
} // namespace ash
2 changes: 0 additions & 2 deletions ash/desktop_background/desktop_background_widget_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "ui/views/widget/widget_observer.h"

namespace ash {
namespace internal {
class RootWindowController;

// This class implements a widget-based wallpaper.
Expand Down Expand Up @@ -89,7 +88,6 @@ class ASH_EXPORT AnimatingDesktopController {
DISALLOW_COPY_AND_ASSIGN(AnimatingDesktopController);
};

} // namespace internal
} // namespace ash

#endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_WIDGET_CONTROLLER_H_
Loading

0 comments on commit 093b8d6

Please sign in to comment.