Commit d6215957 authored by alicet@chromium.org's avatar alicet@chromium.org

Remove PinnedContentsInfoBubble which doesn't look like it is used.

BUG=98323
TEST=None


Review URL: http://codereview.chromium.org/8564038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110100 0039d316-1c4b-4281-b951-d872f2087c98
parent e3a2056a
// 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.
#include "chrome/browser/ui/views/pinned_contents_info_bubble.h"
#include "views/bubble/bubble_border.h"
void PinnedContentsBorderContents::SizeAndGetBounds(
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
bool allow_bubble_offscreen,
const gfx::Size& contents_size,
gfx::Rect* contents_bounds,
gfx::Rect* window_bounds) {
// Arrow offset is calculated from the middle of the |position_relative_to|.
int offset = position_relative_to.x() + (position_relative_to.width() / 2);
offset -= bubble_anchor_.x();
gfx::Insets insets;
bubble_border()->GetInsets(&insets);
offset += content_margins().left() + insets.left() + 1;
bubble_border()->SetArrowOffset(offset, contents_size);
BorderContents::SizeAndGetBounds(
position_relative_to, arrow_location,
true, // Don't move the bubble around if it does not fit on the screen.
contents_size, contents_bounds, window_bounds);
// Now move the y position to make sure the bubble contents overlap the view.
window_bounds->Offset(0, -(content_margins().top() + 1));
}
// Bubble -----------------------------------------------------------------
// static
PinnedContentsInfoBubble* PinnedContentsInfoBubble::Show(
views::Widget* parent,
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
const gfx::Point& bubble_anchor,
views::View* contents,
BubbleDelegate* delegate) {
PinnedContentsInfoBubble* bubble =
new PinnedContentsInfoBubble(bubble_anchor);
bubble->InitBubble(parent, position_relative_to, arrow_location,
views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR,
contents, delegate);
return bubble;
}
BorderContents* PinnedContentsInfoBubble::CreateBorderContents() {
return new PinnedContentsBorderContents(bubble_anchor_);
}
// 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_PINNED_CONTENTS_INFO_BUBBLE_H_
#define CHROME_BROWSER_UI_VIEWS_PINNED_CONTENTS_INFO_BUBBLE_H_
#pragma once
#include "chrome/browser/ui/views/bubble/border_contents.h"
#include "chrome/browser/ui/views/bubble/bubble.h"
// This is a specialization of BorderContents, used to draw a border around
// an Bubble that has its contents pinned to a specific location. See
// base class for details.
class PinnedContentsBorderContents : public BorderContents {
public:
explicit PinnedContentsBorderContents(const gfx::Point& bubble_anchor)
: bubble_anchor_(bubble_anchor) {}
// BorderContents overrides:
virtual void SizeAndGetBounds(
const gfx::Rect& position_relative_to, // In screen coordinates
views::BubbleBorder::ArrowLocation arrow_location,
bool allow_bubble_offscreen,
const gfx::Size& contents_size,
gfx::Rect* contents_bounds, // Returned in window coordinates
gfx::Rect* window_bounds); // Returned in screen coordinates
private:
// The location of the pinned contents (in screen coordinates).
const gfx::Point bubble_anchor_;
DISALLOW_COPY_AND_ASSIGN(PinnedContentsBorderContents);
};
// A specialization of the Bubble. Used to draw an Bubble which, in
// addition to having an arrow pointing to where the user clicked, also shifts
// the bubble horizontally to fix it to a specific location. See base class
// for details.
class PinnedContentsInfoBubble : public Bubble {
public:
// Shows the Bubble (see base class function for details).
// |bubble_anchor| specifies how far horizontally to shift the bubble in
// order to anchor its contents. Once the Bubble has been anchored its
// arrow may be pointing to a slightly different |y| location than specified
// in |position_relative_to|.
static PinnedContentsInfoBubble* Show(
views::Widget* parent,
const gfx::Rect& position_relative_to,
views::BubbleBorder::ArrowLocation arrow_location,
const gfx::Point& bubble_anchor_,
views::View* contents,
BubbleDelegate* delegate);
// Bubble overrides:
virtual BorderContents* CreateBorderContents();
private:
explicit PinnedContentsInfoBubble(const gfx::Point& bubble_anchor)
: bubble_anchor_(bubble_anchor) {}
virtual ~PinnedContentsInfoBubble() {}
// The location of the pinned contents (in screen coordinates).
const gfx::Point bubble_anchor_;
DISALLOW_COPY_AND_ASSIGN(PinnedContentsInfoBubble);
};
#endif // CHROME_BROWSER_UI_VIEWS_PINNED_CONTENTS_INFO_BUBBLE_H_
......@@ -3520,8 +3520,6 @@
'browser/ui/views/page_info_bubble_view.cc',
'browser/ui/views/page_info_bubble_view.h',
'browser/ui/views/page_info_window.h',
'browser/ui/views/pinned_contents_info_bubble.cc',
'browser/ui/views/pinned_contents_info_bubble.h',
'browser/ui/views/reload_button.cc',
'browser/ui/views/reload_button.h',
'browser/ui/views/repost_form_warning_view.cc',
......@@ -4827,8 +4825,6 @@
['include', '^browser/ui/views/omnibox/omnibox_view_views.cc'],
['include', '^browser/ui/views/omnibox/omnibox_view_views.h'],
['include', '^browser/ui/views/page_info_bubble_view.cc'],
['include', '^browser/ui/views/pinned_contents_info_bubble.cc'],
['include', '^browser/ui/views/pinned_contents_info_bubble.h'],
['include', '^browser/ui/views/profile_tag_view.cc'],
['include', '^browser/ui/views/profile_tag_view.h'],
['include', '^browser/ui/views/reload_button.cc'],
......
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