OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
6 | 6 |
7 #include "base/string16.h" | 7 #include "base/string16.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // of the field's left edge. | 47 // of the field's left edge. |
48 static const int kMinimumFieldSize = 180; | 48 static const int kMinimumFieldSize = 180; |
49 | 49 |
50 // Bubble close image. | 50 // Bubble close image. |
51 static SkBitmap* kCloseImage = NULL; | 51 static SkBitmap* kCloseImage = NULL; |
52 | 52 |
53 // Declared in browser_dialogs.h so callers don't have to depend on our header. | 53 // Declared in browser_dialogs.h so callers don't have to depend on our header. |
54 | 54 |
55 namespace browser { | 55 namespace browser { |
56 | 56 |
57 void ShowBookmarkBubbleView(views::Window* parent, | 57 void ShowBookmarkBubbleView(views::Widget* parent, |
58 const gfx::Rect& bounds, | 58 const gfx::Rect& bounds, |
59 BubbleDelegate* delegate, | 59 BubbleDelegate* delegate, |
60 Profile* profile, | 60 Profile* profile, |
61 const GURL& url, | 61 const GURL& url, |
62 bool newly_bookmarked) { | 62 bool newly_bookmarked) { |
63 BookmarkBubbleView::Show(parent, bounds, delegate, profile, url, | 63 BookmarkBubbleView::Show(parent, bounds, delegate, profile, url, |
64 newly_bookmarked); | 64 newly_bookmarked); |
65 } | 65 } |
66 | 66 |
67 void HideBookmarkBubbleView() { | 67 void HideBookmarkBubbleView() { |
68 BookmarkBubbleView::Hide(); | 68 BookmarkBubbleView::Hide(); |
69 } | 69 } |
70 | 70 |
71 bool IsBookmarkBubbleViewShowing() { | 71 bool IsBookmarkBubbleViewShowing() { |
72 return BookmarkBubbleView::IsShowing(); | 72 return BookmarkBubbleView::IsShowing(); |
73 } | 73 } |
74 | 74 |
75 } // namespace browser | 75 } // namespace browser |
76 | 76 |
77 // BookmarkBubbleView --------------------------------------------------------- | 77 // BookmarkBubbleView --------------------------------------------------------- |
78 | 78 |
79 BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL; | 79 BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL; |
80 | 80 |
81 // static | 81 // static |
82 void BookmarkBubbleView::Show(views::Window* parent, | 82 void BookmarkBubbleView::Show(views::Widget* parent, |
83 const gfx::Rect& bounds, | 83 const gfx::Rect& bounds, |
84 BubbleDelegate* delegate, | 84 BubbleDelegate* delegate, |
85 Profile* profile, | 85 Profile* profile, |
86 const GURL& url, | 86 const GURL& url, |
87 bool newly_bookmarked) { | 87 bool newly_bookmarked) { |
88 if (IsShowing()) | 88 if (IsShowing()) |
89 return; | 89 return; |
90 | 90 |
91 bookmark_bubble_ = new BookmarkBubbleView(delegate, profile, url, | 91 bookmark_bubble_ = new BookmarkBubbleView(delegate, profile, url, |
92 newly_bookmarked); | 92 newly_bookmarked); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 const BookmarkNode* new_parent = | 422 const BookmarkNode* new_parent = |
423 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 423 parent_model_.GetNodeAt(parent_combobox_->selected_item()); |
424 if (new_parent != node->parent()) { | 424 if (new_parent != node->parent()) { |
425 UserMetrics::RecordAction( | 425 UserMetrics::RecordAction( |
426 UserMetricsAction("BookmarkBubble_ChangeParent")); | 426 UserMetricsAction("BookmarkBubble_ChangeParent")); |
427 model->Move(node, new_parent, new_parent->child_count()); | 427 model->Move(node, new_parent, new_parent->child_count()); |
428 } | 428 } |
429 } | 429 } |
430 } | 430 } |
431 } | 431 } |
OLD | NEW |