summaryrefslogtreecommitdiffstats
path: root/mojo/examples
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 22:50:12 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 22:50:12 +0000
commitb17d3b5564896a8b2e1b9ca9cbd6022caa456490 (patch)
tree1d97ff4914db880ab0584955581bb117da5d1485 /mojo/examples
parent4f25bc2eef85795db352ef572193c2d54650a35f (diff)
downloadchromium_src-b17d3b5564896a8b2e1b9ca9cbd6022caa456490.zip
chromium_src-b17d3b5564896a8b2e1b9ca9cbd6022caa456490.tar.gz
chromium_src-b17d3b5564896a8b2e1b9ca9cbd6022caa456490.tar.bz2
Mojo demo: fix random background.
BUG=378153 TEST=None R=ben@chromium.org Review URL: https://codereview.chromium.org/337263006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/examples')
-rw-r--r--mojo/examples/browser/browser.cc3
-rw-r--r--mojo/examples/media_viewer/media_viewer.cc4
-rw-r--r--mojo/examples/png_viewer/png_viewer.cc7
3 files changed, 8 insertions, 6 deletions
diff --git a/mojo/examples/browser/browser.cc b/mojo/examples/browser/browser.cc
index 2d91eeb..1474556 100644
--- a/mojo/examples/browser/browser.cc
+++ b/mojo/examples/browser/browser.cc
@@ -21,6 +21,7 @@
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
#include "ui/events/event.h"
+#include "ui/views/background.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/controls/textfield/textfield_controller.h"
#include "ui/views/focus/focus_manager.h"
@@ -174,6 +175,8 @@ class Browser : public ApplicationDelegate,
textfield->set_controller(this);
views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
+ widget_delegate->GetContentsView()->set_background(
+ views::Background::CreateSolidBackground(SK_ColorBLUE));
widget_delegate->GetContentsView()->AddChildView(textfield);
widget_delegate->GetContentsView()->SetLayoutManager(
new BrowserLayoutManager);
diff --git a/mojo/examples/media_viewer/media_viewer.cc b/mojo/examples/media_viewer/media_viewer.cc
index e4ea4c6..2470c46 100644
--- a/mojo/examples/media_viewer/media_viewer.cc
+++ b/mojo/examples/media_viewer/media_viewer.cc
@@ -30,6 +30,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/rect.h"
+#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/label_button.h"
@@ -141,6 +142,9 @@ class ControlPanel : public views::ButtonListener {
widget_delegate->GetContentsView()->SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kHorizontal, 5, 2, 5));
+ widget_delegate->GetContentsView()->set_background(
+ views::Background::CreateSolidBackground(SK_ColorLTGRAY));
+
for (int type = 0; type < CONTROL_COUNT; ++type) {
views::Button* button = new views::LabelButton(
this, base::ASCIIToUTF16(kNames[type]));
diff --git a/mojo/examples/png_viewer/png_viewer.cc b/mojo/examples/png_viewer/png_viewer.cc
index dfa8e7b..62dcd2b 100644
--- a/mojo/examples/png_viewer/png_viewer.cc
+++ b/mojo/examples/png_viewer/png_viewer.cc
@@ -162,7 +162,7 @@ class PNGViewer : public ApplicationDelegate,
view_manager::Node* root) OVERRIDE {
content_view_ = view_manager::View::Create(view_manager);
root->SetActiveView(content_view_);
- content_view_->SetColor(SK_ColorRED);
+ content_view_->SetColor(SK_ColorGRAY);
if (!bitmap_.isNull())
DrawBitmap();
}
@@ -171,11 +171,6 @@ class PNGViewer : public ApplicationDelegate,
if (!content_view_)
return;
- if (zoom_percentage_ == kDefaultZoomPercentage) {
- content_view_->SetContents(bitmap_);
- return;
- }
-
skia::RefPtr<SkCanvas> canvas(skia::AdoptRef(skia::CreatePlatformCanvas(
content_view_->node()->bounds().width(),
content_view_->node()->bounds().height(),