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

Unified Diff: chrome/browser/ui/views/first_run_bubble_view_views.h

Issue 8265005: first run bubble using the views/bubble api. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/first_run_bubble.h ('k') | chrome/browser/ui/views/first_run_bubble_view_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/first_run_bubble_view_views.h
diff --git a/chrome/browser/ui/views/first_run_bubble_view_views.h b/chrome/browser/ui/views/first_run_bubble_view_views.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f93613929bf2953dd389ad851112be807d5b928
--- /dev/null
+++ b/chrome/browser/ui/views/first_run_bubble_view_views.h
@@ -0,0 +1,199 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_VIEW_VIEWS_H_
+#define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_VIEW_VIEWS_H_
+#pragma once
+
+#include "views/bubble/bubble_border.h"
+#include "views/bubble/bubble_delegate.h"
+#include "views/controls/button/button.h"
+#include "views/controls/button/text_button.h"
+#include "views/focus/focus_manager.h"
+#include "views/widget/widget.h"
+
+class Profile;
+
+namespace views {
+class ImageButton;
+class Label;
+class NativeTextButton;
+};
+
+
+// FirstRunBubbleViewBase ------------------------------------------------------
+// Base class for implementations of the first run bubble views.
+class FirstRunBubbleViewBase : public views::View,
+ public views::ButtonListener,
+ public views::FocusChangeListener {
+ public:
+ // Called by FirstRunBubble to request focus for the proper button
+ // in the FirstRunBubbleView variants when it is shown.
+ virtual void BubbleShown() = 0;
+};
+
+// FirstRunBubbleViewViews -----------------------------------------------------
+class FirstRunBubbleViewViews : public views::BubbleDelegateView {
+ public:
+ FirstRunBubbleViewViews(Profile* profile,
+ views::Widget* parent,
+ const gfx::Rect& position_relative_to,
+ views::BubbleBorder::ArrowLocation arrow_location);
+ virtual ~FirstRunBubbleViewViews();
+
+ // view::BubbleDelegate:
+ virtual SkColor GetFrameBackgroundColor();
+ virtual gfx::Rect GetBounds();
+ virtual views::BubbleBorder::ArrowLocation GetFrameArrowLocation();
+ virtual views::Widget* GetWidget() OVERRIDE;
msw 2011/10/13 23:09:22 You shouldn't need to override GetWidget/GetConten
+ virtual const views::Widget* GetWidget() const OVERRIDE;
+ virtual views::View* GetContentsView();
+ private:
+ Profile* profile_;
+ views::Widget* parent_;
+ const gfx::Rect position_relative_to_;
+ views::BubbleBorder::ArrowLocation arrow_location_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleViewViews);
+};
+
+// FirstRunBubbleView ----------------------------------------------------------
+class FirstRunBubbleView : public FirstRunBubbleViewBase {
+ public:
+ FirstRunBubbleView(views::Widget* widget, Profile* profile);
+ // FirstRunBubbleViewBase:
+ virtual void BubbleShown();
+
+ private:
+ virtual ~FirstRunBubbleView();
+
+ // Overridden from View:
+ virtual void ButtonPressed(views::Button* sender, const views::Event& event);
+ virtual void Layout();
+ virtual gfx::Size GetPreferredSize();
+
+ // FocusChangeListener:
+ virtual void FocusWillChange(View* focused_before, View* focused_now);
+
+ private:
+ views::Widget* widget_;
+ views::Label* label1_;
+ views::Label* label2_;
+ views::Label* label3_;
+ views::NativeTextButton* change_button_;
+ views::NativeTextButton* keep_button_;
+ Profile* profile_;
+ DISALLOW_COPY_AND_ASSIGN(FirstRunBubbleView);
+};
+
+// FirstRunOEMBubbleViewViews --------------------------------------------------
+class FirstRunOEMBubbleViewViews : public views::BubbleDelegateView {
+ public:
+ FirstRunOEMBubbleViewViews(Profile* profile,
+ views::Widget* parent,
+ const gfx::Rect& position_relative_to,
+ views::BubbleBorder::ArrowLocation arrow_location);
+ virtual ~FirstRunOEMBubbleViewViews();
+
+ // view::BubbleDelegate:
+ virtual SkColor GetFrameBackgroundColor();
+ virtual gfx::Rect GetBounds();
+ virtual views::BubbleBorder::ArrowLocation GetFrameArrowLocation();
+ virtual views::Widget* GetWidget() OVERRIDE;
+ virtual const views::Widget* GetWidget() const OVERRIDE;
+ virtual views::View* GetContentsView();
+ private:
+ Profile* profile_;
+ views::Widget* parent_;
+ const gfx::Rect position_relative_to_;
+ views::BubbleBorder::ArrowLocation arrow_location_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunOEMBubbleViewViews);
+};
+
+// FirstRunOEMBubbleView ------------------------------------------------------
+
+class FirstRunOEMBubbleView : public FirstRunBubbleViewBase {
+ public:
+ FirstRunOEMBubbleView(views::Widget* widget, Profile* profile);
+
+ // FirstRunBubbleViewBase:
+ virtual void BubbleShown();
+
+ private:
+ virtual ~FirstRunOEMBubbleView();
+
+ // Overridden from View:
+ virtual void ButtonPressed(views::Button* sender, const views::Event& event);
+ virtual void Layout();
+ virtual gfx::Size GetPreferredSize();
+
+ // FocusChangeListener:
+ virtual void FocusWillChange(View* focused_before, View* focused_now);
+
+ views::Widget* widget_;
+ views::Label* label1_;
+ views::Label* label2_;
+ views::Label* label3_;
+ views::ImageButton* close_button_;
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunOEMBubbleView);
+};
+
+// FirstRunMinimalBubbleViewViews ----------------------------------------------
+class FirstRunMinimalBubbleViewViews : public views::BubbleDelegateView {
+ public:
+ FirstRunMinimalBubbleViewViews(
+ Profile* profile,
+ views::Widget* parent,
+ const gfx::Rect& position_relative_to,
+ views::BubbleBorder::ArrowLocation arrow_location);
+ virtual ~FirstRunMinimalBubbleViewViews();
+
+ // view::BubbleDelegate:
+ virtual SkColor GetFrameBackgroundColor();
+ virtual gfx::Rect GetBounds();
+ virtual views::BubbleBorder::ArrowLocation GetFrameArrowLocation();
+ virtual views::Widget* GetWidget() OVERRIDE;
+ virtual const views::Widget* GetWidget() const OVERRIDE;
+ virtual views::View* GetContentsView();
+ private:
+ Profile* profile_;
+ views::Widget* parent_;
+ const gfx::Rect position_relative_to_;
+ views::BubbleBorder::ArrowLocation arrow_location_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunMinimalBubbleViewViews);
+};
+
+// FirstRunMinimalBubbleView --------------------------------------------------
+class FirstRunMinimalBubbleView : public FirstRunBubbleViewBase {
+ public:
+ FirstRunMinimalBubbleView(views::Widget* widget, Profile* profile);
+
+ // FirstRunBubbleViewBase:
+ virtual void BubbleShown();
+
+ private:
+ virtual ~FirstRunMinimalBubbleView();
+
+ // Overridden from View:
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) { }
+ virtual void Layout();
+ virtual gfx::Size GetPreferredSize();
+
+ // FocusChangeListener:
+ virtual void FocusWillChange(View* focused_before, View* focused_now);
+
+ views::Widget* widget_;
+ views::Label* label1_;
+ views::Label* label2_;
+ Profile* profile_;
+
+ DISALLOW_COPY_AND_ASSIGN(FirstRunMinimalBubbleView);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_VIEW_VIEWS_H_
« no previous file with comments | « chrome/browser/ui/views/first_run_bubble.h ('k') | chrome/browser/ui/views/first_run_bubble_view_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698