Commit 7913d649 authored by tfarina@chromium.org's avatar tfarina@chromium.org

views/examples: Pure pedantic change.

No need of views:: while already inside views namespace. Using views:: is
incosistent, as at other places in examples we don't use it.

R=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10824016

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148904 0039d316-1c4b-4281-b951-d872f2087c98
parent 98599120
...@@ -32,15 +32,17 @@ namespace views { ...@@ -32,15 +32,17 @@ namespace views {
namespace examples { namespace examples {
namespace { namespace {
class ExamplesViewsDelegate : public views::TestViewsDelegate {
class ExamplesViewsDelegate : public TestViewsDelegate {
public: public:
#if defined(USE_AURA) #if defined(USE_AURA)
virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper( virtual NativeWidgetHelperAura* CreateNativeWidgetHelper(
views::NativeWidgetAura* native_widget) OVERRIDE { NativeWidgetAura* native_widget) OVERRIDE {
return new views::DesktopNativeWidgetHelperAura(native_widget); return new DesktopNativeWidgetHelperAura(native_widget);
} }
#endif #endif
}; };
} // namespace } // namespace
ExamplesBrowserMainParts::ExamplesBrowserMainParts( ExamplesBrowserMainParts::ExamplesBrowserMainParts(
...@@ -60,8 +62,7 @@ void ExamplesBrowserMainParts::PreMainMessageLoopRun() { ...@@ -60,8 +62,7 @@ void ExamplesBrowserMainParts::PreMainMessageLoopRun() {
#endif #endif
views_delegate_.reset(new ExamplesViewsDelegate); views_delegate_.reset(new ExamplesViewsDelegate);
views::examples::ShowExamplesWindow(views::examples::QUIT_ON_CLOSE, ShowExamplesWindow(QUIT_ON_CLOSE, browser_context_.get());
browser_context_.get());
} }
void ExamplesBrowserMainParts::PostMainMessageLoopRun() { void ExamplesBrowserMainParts::PostMainMessageLoopRun() {
...@@ -76,7 +77,7 @@ void ExamplesBrowserMainParts::PostMainMessageLoopRun() { ...@@ -76,7 +77,7 @@ void ExamplesBrowserMainParts::PostMainMessageLoopRun() {
bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) { bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) {
// xxx: Hax here because this kills event handling. // xxx: Hax here because this kills event handling.
#if !defined(USE_AURA) #if !defined(USE_AURA)
views::AcceleratorHandler accelerator_handler; AcceleratorHandler accelerator_handler;
base::RunLoop run_loop(&accelerator_handler); base::RunLoop run_loop(&accelerator_handler);
#else #else
base::RunLoop run_loop; base::RunLoop run_loop;
......
...@@ -16,13 +16,13 @@ class StackingClient; ...@@ -16,13 +16,13 @@ class StackingClient;
} }
namespace content { namespace content {
class ShellBrowserContext; class ShellBrowserContext;
struct MainFunctionParams; struct MainFunctionParams;
} }
namespace views { namespace views {
class ViewsDelegate; class ViewsDelegate;
namespace examples { namespace examples {
class ExamplesBrowserMainParts : public content::BrowserMainParts { class ExamplesBrowserMainParts : public content::BrowserMainParts {
...@@ -43,7 +43,7 @@ class ExamplesBrowserMainParts : public content::BrowserMainParts { ...@@ -43,7 +43,7 @@ class ExamplesBrowserMainParts : public content::BrowserMainParts {
private: private:
scoped_ptr<content::ShellBrowserContext> browser_context_; scoped_ptr<content::ShellBrowserContext> browser_context_;
scoped_ptr<views::ViewsDelegate> views_delegate_; scoped_ptr<ViewsDelegate> views_delegate_;
#if defined(USE_AURA) #if defined(USE_AURA)
scoped_ptr<aura::client::StackingClient> stacking_client_; scoped_ptr<aura::client::StackingClient> stacking_client_;
#endif #endif
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -7,17 +7,20 @@ ...@@ -7,17 +7,20 @@
#include "ui/views/controls/single_split_view.h" #include "ui/views/controls/single_split_view.h"
#include "ui/views/layout/grid_layout.h" #include "ui/views/layout/grid_layout.h"
namespace views {
namespace examples {
namespace { namespace {
// DoubleSplitViews's content, which draws gradient color on background. // DoubleSplitViews's content, which draws gradient color on background.
class SplittedView : public views::View { class SplittedView : public View {
public: public:
SplittedView(); SplittedView();
virtual ~SplittedView(); virtual ~SplittedView();
void SetColor(SkColor from, SkColor to); void SetColor(SkColor from, SkColor to);
// Overridden from views::View. // Overridden from View.
virtual gfx::Size GetMinimumSize() OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE;
private: private:
...@@ -32,8 +35,7 @@ SplittedView::~SplittedView() { ...@@ -32,8 +35,7 @@ SplittedView::~SplittedView() {
} }
void SplittedView::SetColor(SkColor from, SkColor to) { void SplittedView::SetColor(SkColor from, SkColor to) {
set_background( set_background(Background::CreateVerticalGradientBackground(from, to));
views::Background::CreateVerticalGradientBackground(from, to));
} }
gfx::Size SplittedView::GetMinimumSize() { gfx::Size SplittedView::GetMinimumSize() {
...@@ -42,9 +44,6 @@ gfx::Size SplittedView::GetMinimumSize() { ...@@ -42,9 +44,6 @@ gfx::Size SplittedView::GetMinimumSize() {
} // namespace } // namespace
namespace views {
namespace examples {
DoubleSplitViewExample::DoubleSplitViewExample() DoubleSplitViewExample::DoubleSplitViewExample()
: ExampleBase("Double Split View") { : ExampleBase("Double Split View") {
} }
......
...@@ -190,8 +190,8 @@ void ExampleMenuButton::OnMenuButtonClicked(View* source, ...@@ -190,8 +190,8 @@ void ExampleMenuButton::OnMenuButtonClicked(View* source,
menu_runner_.reset(new MenuRunner(menu_model_adapter.CreateMenu())); menu_runner_.reset(new MenuRunner(menu_model_adapter.CreateMenu()));
if (menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), this, if (menu_runner_->RunMenuAt(source->GetWidget()->GetTopLevelWidget(), this,
gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPRIGHT, gfx::Rect(point, gfx::Size()), MenuItemView::TOPRIGHT,
views::MenuRunner::HAS_MNEMONICS) == views::MenuRunner::MENU_DELETED) MenuRunner::HAS_MNEMONICS) == MenuRunner::MENU_DELETED)
return; return;
} }
......
...@@ -36,7 +36,7 @@ void SliderExample::CreateExampleView(View* container) { ...@@ -36,7 +36,7 @@ void SliderExample::CreateExampleView(View* container) {
void SliderExample::SliderValueChanged(Slider* sender, void SliderExample::SliderValueChanged(Slider* sender,
float value, float value,
float old_value, float old_value,
views::SliderChangeReason reason) { SliderChangeReason reason) {
label_->SetText(ASCIIToUTF16(base::StringPrintf("%.3lf", value))); label_->SetText(ASCIIToUTF16(base::StringPrintf("%.3lf", value)));
} }
......
...@@ -28,7 +28,7 @@ class SliderExample : public ExampleBase, public SliderListener { ...@@ -28,7 +28,7 @@ class SliderExample : public ExampleBase, public SliderListener {
virtual void SliderValueChanged(Slider* sender, virtual void SliderValueChanged(Slider* sender,
float value, float value,
float old_value, float old_value,
views::SliderChangeReason reason) OVERRIDE; SliderChangeReason reason) OVERRIDE;
Slider* slider_; Slider* slider_;
Label* label_; Label* label_;
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
#include "ui/views/layout/grid_layout.h" #include "ui/views/layout/grid_layout.h"
#include "ui/views/view.h" #include "ui/views/view.h"
namespace views {
namespace examples {
namespace { namespace {
// Number of columns in the view layout. // Number of columns in the view layout.
...@@ -73,7 +76,7 @@ const char* kVerticalAlignments[] = { ...@@ -73,7 +76,7 @@ const char* kVerticalAlignments[] = {
}; };
// Toggles bit |flag| on |flags| based on state of |checkbox|. // Toggles bit |flag| on |flags| based on state of |checkbox|.
void SetFlagFromCheckbox(views::Checkbox* checkbox, int* flags, int flag) { void SetFlagFromCheckbox(Checkbox* checkbox, int* flags, int flag) {
if (checkbox->checked()) if (checkbox->checked())
*flags |= flag; *flags |= flag;
else else
...@@ -82,9 +85,6 @@ void SetFlagFromCheckbox(views::Checkbox* checkbox, int* flags, int flag) { ...@@ -82,9 +85,6 @@ void SetFlagFromCheckbox(views::Checkbox* checkbox, int* flags, int flag) {
} // namespace } // namespace
namespace views {
namespace examples {
// TextExample's content view, which is responsible for drawing a string with // TextExample's content view, which is responsible for drawing a string with
// the specified style. // the specified style.
class TextExample::TextExampleView : public View { class TextExample::TextExampleView : public View {
...@@ -202,7 +202,7 @@ Combobox* TextExample::AddCombobox(GridLayout* layout, ...@@ -202,7 +202,7 @@ Combobox* TextExample::AddCombobox(GridLayout* layout,
void TextExample::CreateExampleView(View* container) { void TextExample::CreateExampleView(View* container) {
text_view_ = new TextExampleView; text_view_ = new TextExampleView;
text_view_->set_border(views::Border::CreateSolidBorder(1, SK_ColorGRAY)); text_view_->set_border(Border::CreateSolidBorder(1, SK_ColorGRAY));
GridLayout* layout = new GridLayout(container); GridLayout* layout = new GridLayout(container);
container->SetLayoutManager(layout); container->SetLayoutManager(layout);
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -19,8 +19,8 @@ namespace examples { ...@@ -19,8 +19,8 @@ namespace examples {
// TextfieldExample mimics login screen. // TextfieldExample mimics login screen.
class TextfieldExample : public ExampleBase, class TextfieldExample : public ExampleBase,
public views::TextfieldController, public TextfieldController,
public views::ButtonListener { public ButtonListener {
public: public:
TextfieldExample(); TextfieldExample();
virtual ~TextfieldExample(); virtual ~TextfieldExample();
......
...@@ -128,11 +128,11 @@ void TreeViewExample::ShowContextMenuForView(View* source, ...@@ -128,11 +128,11 @@ void TreeViewExample::ShowContextMenuForView(View* source,
context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit")); context_menu_model.AddItem(ID_EDIT, ASCIIToUTF16("Edit"));
context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove")); context_menu_model.AddItem(ID_REMOVE, ASCIIToUTF16("Remove"));
context_menu_model.AddItem(ID_ADD, ASCIIToUTF16("Add")); context_menu_model.AddItem(ID_ADD, ASCIIToUTF16("Add"));
views::MenuModelAdapter menu_adapter(&context_menu_model); MenuModelAdapter menu_adapter(&context_menu_model);
context_menu_runner_.reset(new views::MenuRunner(menu_adapter.CreateMenu())); context_menu_runner_.reset(new MenuRunner(menu_adapter.CreateMenu()));
if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL, if (context_menu_runner_->RunMenuAt(source->GetWidget(), NULL,
gfx::Rect(point, gfx::Size()), views::MenuItemView::TOPLEFT, 0) == gfx::Rect(point, gfx::Size()), MenuItemView::TOPLEFT, 0) ==
views::MenuRunner::MENU_DELETED) MenuRunner::MENU_DELETED)
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment