Search is not available for this dataset
Unnamed: 0
int64 3
189k
| Access Gained
stringclasses 2
values | Attack Origin
stringclasses 4
values | Authentication Required
stringclasses 3
values | Availability
stringclasses 3
values | CVE ID
stringlengths 13
43
⌀ | CVE Page
stringlengths 45
48
⌀ | CWE ID
stringclasses 90
values | Complexity
stringclasses 4
values | Confidentiality
stringclasses 3
values | Integrity
stringclasses 3
values | Known Exploits
float64 | Publish Date
stringclasses 911
values | Score
float64 0
10
⌀ | Summary
stringlengths 60
1.32k
⌀ | Update Date
stringclasses 671
values | Vulnerability Classification
stringclasses 75
values | add_lines
int64 0
382
| codeLink
stringlengths 46
139
| commit_id
stringlengths 6
81
| commit_message
stringlengths 3
13.3k
⌀ | del_lines
int64 0
459
| file_name
stringlengths 4
100
⌀ | files_changed
stringlengths 345
13.9M
⌀ | func_after
stringlengths 14
235k
| func_before
stringlengths 14
234k
| lang
stringclasses 3
values | lines_after
stringlengths 1
10k
⌀ | lines_before
stringlengths 2
10.2k
⌀ | parentID
stringclasses 626
values | patch
stringlengths 101
359k
| project
stringclasses 305
values | project_after
stringlengths 6
200
| project_before
stringlengths 40
200
| vul
int64 0
1
| vul_func_with_fix
stringlengths 14
235k
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
172,251
| null |
Remote
|
Not required
| null |
CVE-2016-3837
|
https://www.cvedetails.com/cve/CVE-2016-3837/
|
CWE-200
|
Medium
|
Partial
| null | null |
2016-08-05
| 4.3
| service/jni/com_android_server_wifi_WifiNative.cpp in Wi-Fi in Android 5.0.x before 5.0.2, 5.1.x before 5.1.1, and 6.x before 2016-08-01 allows attackers to obtain sensitive information via a crafted application that provides a MAC address with too few characters, aka internal bug 28164077.(...TRUNCATED)
|
2016-11-28
|
+Info
| 0
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399
|
a209ff12ba9617c10550678ff93d01fb72a33399
| Deal correctly with short strings
The parseMacAddress function anticipates only properly formed
MAC addresses (6 hexadecimal octets separated by ":"). This
change properly deals with situations where the string is
shorter than expected, making sure that the passed in char*
reference in parseHexByte never exceeds the end of the string.
BUG: 28164077
TEST: Added a main function:
int main(int argc, char **argv) {
unsigned char addr[6];
if (argc > 1) {
memset(addr, 0, sizeof(addr));
parseMacAddress(argv[1], addr);
printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n",
addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
}
}
Tested with "", "a" "ab" "ab:c" "abxc".
Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386
(...TRUNCATED)
| 0
|
service/jni/com_android_server_wifi_WifiNative.cpp
| {"filename": "service/jni/com_android_server_wifi_WifiNative.cpp", "raw_url": "https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399/service/jni/com_android_server_wifi_WifiNative.cpp", "patch": "@@ -697,15 +697,23 @@\n\n }\n \n static byte parseHexByte(const char * &str) {\n+ if (str[0] == '\\0') {\n+ ALOGE(\"Passed an empty string\");\n+ return 0;\n+ }\n byte b = parseHexChar(str[0]);\n- if (str[1] == ':' || str[1] == '\\0') {\n- str += 2;\n- return b;\n+ if (str[1] == '\\0' || str[1] == ':') {\n+ str ++;\n } else {\n b = b << 4 | parseHexChar(str[1]);\n- str += 3;\n- return b;\n+ str += 2;\n }\n+\n+ // Skip trailing delimiter if not at the end of the string.\n+ if (str[0] != '\\0') {\n+ str++;\n+ }\n+ return b;\n }\n \n static void parseMacAddress(const char *str, mac_addr addr) {\n"}(...TRUNCATED)
| static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
(...TRUNCATED)
| static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
(...TRUNCATED)
|
C
| null | null | null | @@ -697,15 +697,23 @@
}
static byte parseHexByte(const char * &str) {
+ if (str[0] == '\0') {
+ ALOGE("Passed an empty string");
+ return 0;
+ }
byte b = parseHexChar(str[0]);
- if (str[1] == ':' || str[1] == '\0') {
- str += 2;
- return b;
+ if (str[1] == '\0' || str[1] == ':') {
+ str ++;
} else {
b = b << 4 | parseHexChar(str[1]);
- str += 3;
- return b;
+ str += 2;
}
+
+ // Skip trailing delimiter if not at the end of the string.
+ if (str[0] != '\0') {
+ str++;
+ }
+ return b;
}
static void parseMacAddress(const char *str, mac_addr addr) {
(...TRUNCATED)
|
Android
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399/
|
https://android.googlesource.com/platform/frameworks/opt/net/wifi/+/a209ff12ba9617c10550678ff93d01fb72a33399%5E/
| 0
| static jobject android_net_wifi_get_driver_version(JNIEnv *env, jclass cls, jint iface) {
//Need to be fixed. The memory should be allocated from lower layer
//char *buffer = NULL;
JNIHelper helper(env);
int buffer_length = 256;
char *buffer = (char *)malloc(buffer_length);
if (!buffer) return NULL;
memset(buffer, 0, buffer_length);
wifi_interface_handle handle = getIfaceHandle(helper, cls, iface);
ALOGD("android_net_wifi_get_driver_version = %p", handle);
if (handle == 0) {
return NULL;
}
wifi_error result = hal_fn.wifi_get_driver_version(handle, buffer, buffer_length);
if (result == WIFI_SUCCESS) {
ALOGD("buffer is %p, length is %d", buffer, buffer_length);
JNIObject<jstring> driver_version = helper.newStringUTF(buffer);
free(buffer);
return driver_version.detach();
} else {
ALOGD("Fail to get driver version");
free(buffer);
return NULL;
}
}
(...TRUNCATED)
|
141,602
| null |
Remote
|
Not required
|
Partial
|
CVE-2016-5156
|
https://www.cvedetails.com/cve/CVE-2016-5156/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2016-09-11
| 6.8
| extensions/renderer/event_bindings.cc in the event bindings in Google Chrome before 53.0.2785.89 on Windows and OS X and before 53.0.2785.92 on Linux attempts to process filtered events after failure to add an event matcher, which allows remote attackers to cause a denial of service (use-after-free) or possibly have unspecified other impact via unknown vectors.(...TRUNCATED)
|
2018-10-30
|
DoS
| 0
|
https://github.com/chromium/chromium/commit/ba011d9f8322c62633a069a59c2c5525e3ff46cc
|
ba011d9f8322c62633a069a59c2c5525e3ff46cc
| Ignore filtered event if an event matcher cannot be added.
BUG=625404
Review-Url: https://codereview.chromium.org/2236133002
Cr-Commit-Position: refs/heads/master@{#411472}(...TRUNCATED)
| 0
|
extensions/renderer/event_bindings.cc
| {"sha": "db5fb60f428af90a3ce4ba3edcfee6a77b1a6729", "filename": "extensions/renderer/event_bindings.cc", "status": "modified", "additions": 7, "deletions": 3, "changes": 10, "blob_url": "https://github.com/chromium/chromium/blob/ba011d9f8322c62633a069a59c2c5525e3ff46cc/extensions/renderer/event_bindings.cc", "raw_url": "https://github.com/chromium/chromium/raw/ba011d9f8322c62633a069a59c2c5525e3ff46cc/extensions/renderer/event_bindings.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/extensions/renderer/event_bindings.cc?ref=ba011d9f8322c62633a069a59c2c5525e3ff46cc", "patch": "@@ -272,14 +272,18 @@ void EventBindings::AttachFilteredEvent(\n filter = base::DictionaryValue::From(std::move(filter_value));\n }\n \n- // Hold onto a weak reference to |filter| so that it can be used after passing\n- // ownership to |event_filter|.\n- base::DictionaryValue* filter_weak = filter.get();\n int id = g_event_filter.Get().AddEventMatcher(\n event_name, ParseEventMatcher(std::move(filter)));\n+ if (id == -1) {\n+ args.GetReturnValue().Set(static_cast<int32_t>(-1));\n+ return;\n+ }\n attached_matcher_ids_.insert(id);\n \n // Only send IPCs the first time a filter gets added.\n+ const EventMatcher* matcher = g_event_filter.Get().GetEventMatcher(id);\n+ DCHECK(matcher);\n+ base::DictionaryValue* filter_weak = matcher->value();\n std::string extension_id = context()->GetExtensionID();\n if (AddFilter(event_name, extension_id, *filter_weak)) {\n bool lazy = ExtensionFrameHelper::IsContextForEventPage(context());"}(...TRUNCATED)
| EventBindings::~EventBindings() {}
(...TRUNCATED)
| EventBindings::~EventBindings() {}
(...TRUNCATED)
|
C
| null | null | null | @@ -272,14 +272,18 @@ void EventBindings::AttachFilteredEvent(
filter = base::DictionaryValue::From(std::move(filter_value));
}
- // Hold onto a weak reference to |filter| so that it can be used after passing
- // ownership to |event_filter|.
- base::DictionaryValue* filter_weak = filter.get();
int id = g_event_filter.Get().AddEventMatcher(
event_name, ParseEventMatcher(std::move(filter)));
+ if (id == -1) {
+ args.GetReturnValue().Set(static_cast<int32_t>(-1));
+ return;
+ }
attached_matcher_ids_.insert(id);
// Only send IPCs the first time a filter gets added.
+ const EventMatcher* matcher = g_event_filter.Get().GetEventMatcher(id);
+ DCHECK(matcher);
+ base::DictionaryValue* filter_weak = matcher->value();
std::string extension_id = context()->GetExtensionID();
if (AddFilter(event_name, extension_id, *filter_weak)) {
bool lazy = ExtensionFrameHelper::IsContextForEventPage(context());(...TRUNCATED)
|
Chrome
|
ba011d9f8322c62633a069a59c2c5525e3ff46cc
|
17a812f225abd54e84dbe4f74c9619d4bdab3cbf
| 0
| EventBindings::~EventBindings() {}
(...TRUNCATED)
|
113,164
| null |
Remote
|
Not required
|
Partial
|
CVE-2012-2895
|
https://www.cvedetails.com/cve/CVE-2012-2895/
|
CWE-119
|
Medium
|
Partial
|
Partial
| null |
2012-09-26
| 6.8
| The PDF functionality in Google Chrome before 22.0.1229.79 allows remote attackers to cause a denial of service or possibly have unspecified other impact via vectors that trigger out-of-bounds write operations.(...TRUNCATED)
|
2017-09-18
|
DoS Overflow
| 0
|
https://github.com/chromium/chromium/commit/3475f5e448ddf5e48888f3d0563245cc46e3c98b
|
3475f5e448ddf5e48888f3d0563245cc46e3c98b
| ash: Add launcher overflow bubble.
- Host a LauncherView in bubble to display overflown items;
- Mouse wheel and two-finger scroll to scroll the LauncherView in bubble in case overflow bubble is overflown;
- Fit bubble when items are added/removed;
- Keep launcher bar on screen when the bubble is shown;
BUG=128054
TEST=Verify launcher overflown items are in a bubble instead of menu.
Review URL: https://chromiumcodereview.appspot.com/10659003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146460 0039d316-1c4b-4281-b951-d872f2087c98(...TRUNCATED)
| 0
|
ash/launcher/launcher.cc
| {"sha": "62ca10dad9e69031c752bf990e997abd4f7e63ec", "filename": "ash/ash.gyp", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/ash.gyp", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/ash.gyp", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/ash.gyp?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -94,6 +94,8 @@\n 'launcher/launcher_types.h',\n 'launcher/launcher_view.cc',\n 'launcher/launcher_view.h',\n+ 'launcher/overflow_bubble.cc',\n+ 'launcher/overflow_bubble.h',\n 'launcher/tabbed_launcher_button.cc',\n 'launcher/tabbed_launcher_button.h',\n 'magnifier/magnification_controller.cc',"}<_**next**_>{"sha": "847509714f35f770f93d0d9a2bd5199bbf3cb9df", "filename": "ash/launcher/launcher.cc", "status": "modified", "additions": 7, "deletions": 1, "changes": 8, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -4,6 +4,8 @@\n \n #include \"ash/launcher/launcher.h\"\n \n+#include <algorithm>\n+\n #include \"ash/focus_cycler.h\"\n #include \"ash/launcher/launcher_delegate.h\"\n #include \"ash/launcher/launcher_model.h\"\n@@ -33,7 +35,7 @@ const int kBackgroundAlpha = 128;\n // The contents view of the Widget. This view contains LauncherView and\n // sizes it to the width of the widget minus the size of the status area.\n class Launcher::DelegateView : public views::WidgetDelegate,\n- public views::AccessiblePaneView{\n+ public views::AccessiblePaneView {\n public:\n explicit DelegateView(Launcher* launcher);\n virtual ~DelegateView();\n@@ -211,6 +213,10 @@ bool Launcher::IsShowingMenu() const {\n return launcher_view_->IsShowingMenu();\n }\n \n+bool Launcher::IsShowingOverflowBubble() const {\n+ return launcher_view_->IsShowingOverflowBubble();\n+}\n+\n views::View* Launcher::GetAppListButtonView() const {\n return launcher_view_->GetAppListButtonView();\n }"}<_**next**_>{"sha": "8ee093ac48e6a932e4d8bba3381592b1dcf80284", "filename": "ash/launcher/launcher.h", "status": "modified", "additions": 2, "deletions": 0, "changes": 2, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -78,6 +78,8 @@ class ASH_EXPORT Launcher : public internal::BackgroundAnimatorDelegate {\n // Returns true if the Launcher is showing a context menu.\n bool IsShowingMenu() const;\n \n+ bool IsShowingOverflowBubble() const;\n+\n views::View* GetAppListButtonView() const;\n \n // Only to be called for testing. Retrieves the LauncherView."}<_**next**_>{"sha": "9991bdb9b22c306e34575492abf492afa4105957", "filename": "ash/launcher/launcher_view.cc", "status": "modified", "additions": 77, "deletions": 65, "changes": 142, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher_view.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -12,6 +12,7 @@\n #include \"ash/launcher/launcher_icon_observer.h\"\n #include \"ash/launcher/launcher_model.h\"\n #include \"ash/launcher/launcher_tooltip_manager.h\"\n+#include \"ash/launcher/overflow_bubble.h\"\n #include \"ash/launcher/tabbed_launcher_button.h\"\n #include \"ash/shell.h\"\n #include \"ash/shell_delegate.h\"\n@@ -44,8 +45,8 @@ using views::View;\n namespace ash {\n namespace internal {\n \n-// Amount content is inset on the left edge.\n-static const int kLeadingInset = 8;\n+// Default amount content is inset on the left edge.\n+static const int kDefaultLeadingInset = 8;\n \n // Minimum distance before drag starts.\n static const int kMinimumDragDistance = 8;\n@@ -267,14 +268,16 @@ LauncherView::LauncherView(LauncherModel* model,\n : model_(model),\n delegate_(delegate),\n view_model_(new views::ViewModel),\n+ first_visible_index_(0),\n last_visible_index_(-1),\n overflow_button_(NULL),\n dragging_(false),\n drag_view_(NULL),\n drag_offset_(0),\n start_drag_index_(-1),\n context_menu_id_(0),\n- alignment_(SHELF_ALIGNMENT_BOTTOM) {\n+ alignment_(SHELF_ALIGNMENT_BOTTOM),\n+ leading_inset_(kDefaultLeadingInset) {\n DCHECK(model_);\n bounds_animator_.reset(new views::BoundsAnimator(this));\n bounds_animator_->AddObserver(this);\n@@ -303,6 +306,8 @@ void LauncherView::Init() {\n \n overflow_button_ = new views::ImageButton(this);\n overflow_button_->set_accessibility_focusable(true);\n+ overflow_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,\n+ views::ImageButton::ALIGN_MIDDLE);\n overflow_button_->SetImage(\n views::CustomButton::BS_NORMAL,\n rb.GetImageNamed(IDR_AURA_LAUNCHER_OVERFLOW).ToImageSkia());\n@@ -328,6 +333,8 @@ void LauncherView::SetAlignment(ShelfAlignment alignment) {\n UpdateFirstButtonPadding();\n LayoutToIdealBounds();\n tooltip_->SetArrowLocation(alignment_);\n+ if (overflow_bubble_.get())\n+ overflow_bubble_->Hide();\n }\n \n gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {\n@@ -346,14 +353,16 @@ gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {\n \n bool LauncherView::IsShowingMenu() const {\n #if !defined(OS_MACOSX)\n- return (overflow_menu_runner_.get() &&\n- overflow_menu_runner_->IsRunning()) ||\n- (launcher_menu_runner_.get() &&\n+ return (launcher_menu_runner_.get() &&\n launcher_menu_runner_->IsRunning());\n #endif\n return false;\n }\n \n+bool LauncherView::IsShowingOverflowBubble() const {\n+ return overflow_bubble_.get() && overflow_bubble_->IsShowing();\n+}\n+\n views::View* LauncherView::GetAppListButtonView() const {\n for (int i = 0; i < model_->item_count(); ++i) {\n if (model_->items()[i].type == TYPE_APP_LIST)\n@@ -396,30 +405,44 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {\n if (!available_size)\n return;\n \n- int x = primary_axis_coordinate(kLeadingInset, 0);\n- int y = primary_axis_coordinate(0, kLeadingInset);\n+ int x = primary_axis_coordinate(leading_inset(), 0);\n+ int y = primary_axis_coordinate(0, leading_inset());\n for (int i = 0; i < view_model_->view_size(); ++i) {\n+ if (i < first_visible_index_) {\n+ view_model_->set_ideal_bounds(i, gfx::Rect(x, y, 0, 0));\n+ continue;\n+ }\n+\n view_model_->set_ideal_bounds(i, gfx::Rect(\n x, y, kLauncherPreferredSize, kLauncherPreferredSize));\n x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n }\n \n+ int app_list_index = view_model_->view_size() - 1;\n+ if (is_overflow_mode()) {\n+ last_visible_index_ = app_list_index - 1;\n+ for (int i = 0; i < view_model_->view_size(); ++i) {\n+ view_model_->view_at(i)->SetVisible(\n+ i >= first_visible_index_ && i <= last_visible_index_);\n+ }\n+ return;\n+ }\n+\n if (view_model_->view_size() > 0) {\n // Makes the first launcher button include the leading inset.\n view_model_->set_ideal_bounds(0, gfx::Rect(gfx::Size(\n- primary_axis_coordinate(kLeadingInset + kLauncherPreferredSize,\n+ primary_axis_coordinate(leading_inset() + kLauncherPreferredSize,\n kLauncherPreferredSize),\n primary_axis_coordinate(kLauncherPreferredSize,\n- kLeadingInset + kLauncherPreferredSize))));\n+ leading_inset() + kLauncherPreferredSize))));\n }\n \n bounds->overflow_bounds.set_size(\n gfx::Size(kLauncherPreferredSize, kLauncherPreferredSize));\n last_visible_index_ = DetermineLastVisibleIndex(\n- available_size - kLeadingInset - kLauncherPreferredSize -\n+ available_size - leading_inset() - kLauncherPreferredSize -\n kButtonSpacing - kLauncherPreferredSize);\n- int app_list_index = view_model_->view_size() - 1;\n bool show_overflow = (last_visible_index_ + 1 < app_list_index);\n \n for (int i = 0; i < view_model_->view_size(); ++i) {\n@@ -431,22 +454,25 @@ void LauncherView::CalculateIdealBounds(IdealBounds* bounds) {\n if (show_overflow) {\n DCHECK_NE(0, view_model_->view_size());\n if (last_visible_index_ == -1) {\n- x = primary_axis_coordinate(kLeadingInset, 0);\n- y = primary_axis_coordinate(0, kLeadingInset);\n+ x = primary_axis_coordinate(leading_inset(), 0);\n+ y = primary_axis_coordinate(0, leading_inset());\n } else {\n x = primary_axis_coordinate(\n view_model_->ideal_bounds(last_visible_index_).right(), 0);\n y = primary_axis_coordinate(0,\n view_model_->ideal_bounds(last_visible_index_).bottom());\n }\n gfx::Rect app_list_bounds = view_model_->ideal_bounds(app_list_index);\n+ bounds->overflow_bounds.set_x(x);\n+ bounds->overflow_bounds.set_y(y);\n+ x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n+ y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n app_list_bounds.set_x(x);\n app_list_bounds.set_y(y);\n view_model_->set_ideal_bounds(app_list_index, app_list_bounds);\n- x = primary_axis_coordinate(x + kLauncherPreferredSize + kButtonSpacing, 0);\n- y = primary_axis_coordinate(0, y + kLauncherPreferredSize + kButtonSpacing);\n- bounds->overflow_bounds.set_x(x);\n- bounds->overflow_bounds.set_y(y);\n+ } else {\n+ if (overflow_bubble_.get())\n+ overflow_bubble_->Hide();\n }\n }\n \n@@ -686,41 +712,20 @@ void LauncherView::GetOverflowItems(std::vector<LauncherItem>* items) {\n }\n }\n \n-void LauncherView::ShowOverflowMenu() {\n-#if !defined(OS_MACOSX)\n- if (!delegate_)\n- return;\n+void LauncherView::ShowOverflowBubble() {\n+ int first_overflow_index = last_visible_index_ + 1;\n+ DCHECK_LT(first_overflow_index, view_model_->view_size() - 1);\n \n- std::vector<LauncherItem> items;\n- GetOverflowItems(&items);\n- if (items.empty())\n- return;\n+ if (!overflow_bubble_.get())\n+ overflow_bubble_.reset(new OverflowBubble());\n \n- MenuDelegateImpl menu_delegate;\n- ui::SimpleMenuModel menu_model(&menu_delegate);\n- for (size_t i = 0; i < items.size(); ++i)\n- menu_model.AddItem(static_cast<int>(i), delegate_->GetTitle(items[i]));\n- views::MenuModelAdapter menu_adapter(&menu_model);\n- overflow_menu_runner_.reset(new views::MenuRunner(menu_adapter.CreateMenu()));\n- gfx::Rect bounds(overflow_button_->size());\n- gfx::Point origin;\n- ConvertPointToScreen(overflow_button_, &origin);\n- if (overflow_menu_runner_->RunMenuAt(GetWidget(), NULL,\n- gfx::Rect(origin, size()), views::MenuItemView::TOPLEFT, 0) ==\n- views::MenuRunner::MENU_DELETED)\n- return;\n+ overflow_bubble_->Show(delegate_,\n+ model_,\n+ overflow_button_,\n+ alignment_,\n+ first_overflow_index);\n \n Shell::GetInstance()->UpdateShelfVisibility();\n-\n- if (menu_delegate.activated_command_id() == -1)\n- return;\n-\n- LauncherID activated_id = items[menu_delegate.activated_command_id()].id;\n- LauncherItems::const_iterator window_iter = model_->ItemByID(activated_id);\n- if (window_iter == model_->items().end())\n- return; // Window was deleted while menu was up.\n- delegate_->ItemClicked(*window_iter, ui::EF_NONE);\n-#endif // !defined(OS_MACOSX)\n }\n \n void LauncherView::UpdateFirstButtonPadding() {\n@@ -729,8 +734,8 @@ void LauncherView::UpdateFirstButtonPadding() {\n // and when shelf alignment changes.\n if (view_model_->view_size() > 0) {\n view_model_->view_at(0)->set_border(views::Border::CreateEmptyBorder(\n- primary_axis_coordinate(0, kLeadingInset),\n- primary_axis_coordinate(kLeadingInset, 0),\n+ primary_axis_coordinate(0, leading_inset()),\n+ primary_axis_coordinate(leading_inset(), 0),\n 0,\n 0));\n }\n@@ -775,28 +780,32 @@ int LauncherView::CancelDrag(int modified_index) {\n gfx::Size LauncherView::GetPreferredSize() {\n IdealBounds ideal_bounds;\n CalculateIdealBounds(&ideal_bounds);\n+\n+ const int app_list_index = view_model_->view_size() - 1;\n+ const int last_button_index = is_overflow_mode() ?\n+ last_visible_index_ : app_list_index;\n+ const gfx::Rect last_button_bounds =\n+ last_button_index >= first_visible_index_ ?\n+ view_model_->view_at(last_button_index)->bounds() :\n+ gfx::Rect(gfx::Size(kLauncherPreferredSize,\n+ kLauncherPreferredSize));\n+\n if (is_horizontal_alignment()) {\n- if (view_model_->view_size() >= 2) {\n- // Should always have two items.\n- return gfx::Size(view_model_->ideal_bounds(1).right() + kLeadingInset,\n- kLauncherPreferredSize);\n- }\n- return gfx::Size(kLauncherPreferredSize * 2 + kLeadingInset * 2,\n+ return gfx::Size(last_button_bounds.right() + leading_inset(),\n kLauncherPreferredSize);\n }\n- if (view_model_->view_size() >= 2) {\n- // Should always have two items.\n- return gfx::Size(kLauncherPreferredSize,\n- view_model_->ideal_bounds(1).bottom() + kLeadingInset);\n- }\n+\n return gfx::Size(kLauncherPreferredSize,\n- kLauncherPreferredSize * 2 + kLeadingInset * 2);\n+ last_button_bounds.bottom() + leading_inset());\n }\n \n void LauncherView::OnBoundsChanged(const gfx::Rect& previous_bounds) {\n LayoutToIdealBounds();\n FOR_EACH_OBSERVER(LauncherIconObserver, observers_,\n OnLauncherIconPositionsChanged());\n+\n+ if (IsShowingOverflowBubble())\n+ overflow_bubble_->Hide();\n }\n \n views::FocusTraversable* LauncherView::GetPaneFocusTraversable() {\n@@ -1002,8 +1011,10 @@ void LauncherView::ButtonPressed(views::Button* sender,\n if (dragging_)\n return;\n \n- if (sender == overflow_button_)\n- ShowOverflowMenu();\n+ if (sender == overflow_button_) {\n+ ShowOverflowBubble();\n+ return;\n+ }\n \n if (!delegate_)\n return;\n@@ -1070,6 +1081,7 @@ void LauncherView::ShowContextMenuForView(views::View* source,\n void LauncherView::OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) {\n FOR_EACH_OBSERVER(LauncherIconObserver, observers_,\n OnLauncherIconPositionsChanged());\n+ PreferredSizeChanged();\n }\n \n void LauncherView::OnBoundsAnimatorDone(views::BoundsAnimator* animator) {"}<_**next**_>{"sha": "086b7241cc3494e9b282c01fb0e8a19f35739b79", "filename": "ash/launcher/launcher_view.h", "status": "modified", "additions": 27, "deletions": 3, "changes": 30, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/launcher_view.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/launcher_view.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -41,6 +41,7 @@ namespace internal {\n class LauncherButton;\n class LauncherTooltipManager;\n class ShelfLayoutManager;\n+class OverflowBubble;\n \n class ASH_EXPORT LauncherView : public views::View,\n public LauncherModelObserver,\n@@ -71,6 +72,9 @@ class ASH_EXPORT LauncherView : public views::View,\n // Returns true if we're showing a menu.\n bool IsShowingMenu() const;\n \n+ // Returns true if overflow bubble is shown.\n+ bool IsShowingOverflowBubble() const;\n+\n views::View* GetAppListButtonView() const;\n \n // Returns true if the mouse cursor exits the area for launcher tooltip.\n@@ -79,6 +83,13 @@ class ASH_EXPORT LauncherView : public views::View,\n // of the buttons area.\n bool ShouldHideTooltip(const gfx::Point& cursor_location);\n \n+ void set_first_visible_index(int first_visible_index) {\n+ first_visible_index_ = first_visible_index;\n+ }\n+\n+ int leading_inset() const { return leading_inset_; }\n+ void set_leading_inset(int leading_inset) { leading_inset_ = leading_inset; }\n+\n // Overridden from FocusTraversable:\n virtual views::FocusSearch* GetFocusSearch() OVERRIDE;\n virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;\n@@ -103,6 +114,10 @@ class ASH_EXPORT LauncherView : public views::View,\n return alignment_ == SHELF_ALIGNMENT_BOTTOM;\n }\n \n+ bool is_overflow_mode() const {\n+ return first_visible_index_ > 0;\n+ }\n+\n // Sets the bounds of each view to its ideal bounds.\n void LayoutToIdealBounds();\n \n@@ -148,7 +163,7 @@ class ASH_EXPORT LauncherView : public views::View,\n void GetOverflowItems(std::vector<LauncherItem>* items);\n \n // Shows the overflow menu.\n- void ShowOverflowMenu();\n+ void ShowOverflowBubble();\n \n // Update first launcher button's padding. This method adds padding to the\n // first button to include the leading inset. It needs to be called once on\n@@ -205,6 +220,11 @@ class ASH_EXPORT LauncherView : public views::View,\n // item in |model_|.\n scoped_ptr<views::ViewModel> view_model_;\n \n+ // Index of first visible launcher item. When it it greater than 0,\n+ // LauncherView is hosted in an overflow bubble. In this mode, it does not\n+ // show browser, app list and overflow button.\n+ int first_visible_index_;\n+\n // Last index of a launcher button that is visible\n // (does not go into overflow).\n int last_visible_index_;\n@@ -213,6 +233,8 @@ class ASH_EXPORT LauncherView : public views::View,\n \n views::ImageButton* overflow_button_;\n \n+ scoped_ptr<OverflowBubble> overflow_bubble_;\n+\n scoped_ptr<LauncherTooltipManager> tooltip_;\n \n // Are we dragging? This is only set if the mouse is dragged far enough to\n@@ -235,15 +257,17 @@ class ASH_EXPORT LauncherView : public views::View,\n scoped_ptr<views::FocusSearch> focus_search_;\n \n #if !defined(OS_MACOSX)\n- scoped_ptr<views::MenuRunner> overflow_menu_runner_;\n-\n scoped_ptr<views::MenuRunner> launcher_menu_runner_;\n #endif\n \n ObserverList<LauncherIconObserver> observers_;\n \n ShelfAlignment alignment_;\n \n+ // Amount content is inset on the left edge (or top edge for vertical\n+ // alignment).\n+ int leading_inset_;\n+\n DISALLOW_COPY_AND_ASSIGN(LauncherView);\n };\n "}<_**next**_>{"sha": "e335f5b2bb00a6c3a55c6535d9a0a267b2204b1c", "filename": "ash/launcher/overflow_bubble.cc", "status": "added", "additions": 291, "deletions": 0, "changes": 291, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/overflow_bubble.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -0,0 +1,291 @@\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+#include \"ash/launcher/overflow_bubble.h\"\n+\n+#include <algorithm>\n+\n+#include \"ash/launcher/launcher_types.h\"\n+#include \"ash/launcher/launcher_view.h\"\n+#include \"ui/gfx/screen.h\"\n+#include \"ui/views/bubble/bubble_delegate.h\"\n+#include \"ui/views/bubble/bubble_frame_view.h\"\n+\n+namespace ash {\n+namespace internal {\n+\n+namespace {\n+\n+// This should be the same color as the darkest launcher bar.\n+const SkColor kLauncherColor = SkColorSetARGB(0x80, 0, 0, 0);\n+\n+// Max bubble size to screen size ratio.\n+const float kMaxBubbleSizeToScreenRatio = 0.5f;\n+\n+// Inner padding in pixels for launcher view inside bubble.\n+const int kPadding = 2;\n+\n+// Padding space in pixels between LauncherView's left/top edge to its contents.\n+const int kLauncherViewLeadingInset = 8;\n+\n+// Gets arrow location based on shelf alignment.\n+views::BubbleBorder::ArrowLocation GetBubbleArrowLocation(\n+ ShelfAlignment shelf_alignment) {\n+ switch (shelf_alignment) {\n+ case ash::SHELF_ALIGNMENT_BOTTOM:\n+ return views::BubbleBorder::BOTTOM_LEFT;\n+ case ash::SHELF_ALIGNMENT_LEFT:\n+ return views::BubbleBorder::LEFT_TOP;\n+ case ash::SHELF_ALIGNMENT_RIGHT:\n+ return views::BubbleBorder::RIGHT_TOP;\n+ default:\n+ NOTREACHED() << \"Unknown shelf alignment \" << shelf_alignment;\n+ return views::BubbleBorder::BOTTOM_LEFT;\n+ }\n+}\n+\n+////////////////////////////////////////////////////////////////////////////////\n+// OverflowBubbleView\n+// OverflowBubbleView hosts a LauncherView to display overflown items.\n+\n+class OverflowBubbleView : public views::BubbleDelegateView {\n+ public:\n+ OverflowBubbleView();\n+ virtual ~OverflowBubbleView();\n+\n+ void InitOverflowBubble(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index);\n+\n+ private:\n+ bool is_horizontal_alignment() const {\n+ return shelf_alignment_ == SHELF_ALIGNMENT_BOTTOM;\n+ }\n+\n+ const gfx::Size GetContentsSize() const {\n+ return static_cast<views::View*>(launcher_view_)->GetPreferredSize();\n+ }\n+\n+ void ScrollByXOffset(int x_offset);\n+ void ScrollByYOffset(int y_offset);\n+\n+ // views::View overrides:\n+ virtual gfx::Size GetPreferredSize() OVERRIDE;\n+ virtual void Layout() OVERRIDE;\n+ virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE;\n+ virtual bool OnMouseWheel(const views::MouseWheelEvent& event) OVERRIDE;\n+ virtual bool OnScrollEvent(const views::ScrollEvent & event) OVERRIDE;\n+\n+ // views::BubbleDelegate overrides:\n+ virtual gfx::Rect GetBubbleBounds() OVERRIDE;\n+\n+ ShelfAlignment shelf_alignment_;\n+ LauncherView* launcher_view_; // Owned by views hierarchy.\n+ gfx::Point scroll_offset_;\n+\n+ DISALLOW_COPY_AND_ASSIGN(OverflowBubbleView);\n+};\n+\n+OverflowBubbleView::OverflowBubbleView()\n+ : shelf_alignment_(SHELF_ALIGNMENT_BOTTOM),\n+ launcher_view_(NULL) {\n+}\n+\n+OverflowBubbleView::~OverflowBubbleView() {\n+}\n+\n+void OverflowBubbleView::InitOverflowBubble(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index) {\n+ shelf_alignment_ = shelf_alignment;\n+\n+ // Makes bubble view has a layer and clip its children layers.\n+ SetPaintToLayer(true);\n+ SetFillsBoundsOpaquely(false);\n+ layer()->SetMasksToBounds(true);\n+\n+ launcher_view_ = new LauncherView(model, delegate, NULL);\n+ launcher_view_->set_first_visible_index(overflow_start_index);\n+ launcher_view_->set_leading_inset(kLauncherViewLeadingInset);\n+ launcher_view_->Init();\n+ launcher_view_->SetAlignment(shelf_alignment);\n+ AddChildView(launcher_view_);\n+\n+ set_anchor_view(anchor);\n+ set_arrow_location(GetBubbleArrowLocation(shelf_alignment));\n+ set_background(NULL);\n+ set_color(kLauncherColor);\n+ set_margin(kPadding);\n+ set_move_with_anchor(true);\n+ views::BubbleDelegateView::CreateBubble(this);\n+}\n+\n+void OverflowBubbleView::ScrollByXOffset(int x_offset) {\n+ const gfx::Rect visible_bounds(GetContentsBounds());\n+ const gfx::Size contents_size(GetContentsSize());\n+\n+ int x = std::min(contents_size.width() - visible_bounds.width(),\n+ std::max(0, scroll_offset_.x() + x_offset));\n+ scroll_offset_.set_x(x);\n+}\n+\n+void OverflowBubbleView::ScrollByYOffset(int y_offset) {\n+ const gfx::Rect visible_bounds(GetContentsBounds());\n+ const gfx::Size contents_size(GetContentsSize());\n+\n+ int y = std::min(contents_size.height() - visible_bounds.height(),\n+ std::max(0, scroll_offset_.y() + y_offset));\n+ scroll_offset_.set_y(y);\n+}\n+\n+gfx::Size OverflowBubbleView::GetPreferredSize() {\n+ gfx::Size preferred_size = GetContentsSize();\n+\n+ const gfx::Rect monitor_rect = gfx::Screen::GetDisplayNearestPoint(\n+ GetAnchorRect().CenterPoint()).work_area();\n+ if (!monitor_rect.IsEmpty()) {\n+ if (is_horizontal_alignment()) {\n+ preferred_size.set_width(std::min(\n+ preferred_size.width(),\n+ static_cast<int>(monitor_rect.width() *\n+ kMaxBubbleSizeToScreenRatio)));\n+ } else {\n+ preferred_size.set_height(std::min(\n+ preferred_size.height(),\n+ static_cast<int>(monitor_rect.height() *\n+ kMaxBubbleSizeToScreenRatio)));\n+ }\n+ }\n+\n+ return preferred_size;\n+}\n+\n+void OverflowBubbleView::Layout() {\n+ const gfx::Point origin(-scroll_offset_.x(), -scroll_offset_.y());\n+ launcher_view_->SetBoundsRect(gfx::Rect(origin, GetContentsSize()));\n+}\n+\n+void OverflowBubbleView::ChildPreferredSizeChanged(views::View* child) {\n+ // Ensures |launch_view_| is still visible.\n+ ScrollByXOffset(0);\n+ ScrollByYOffset(0);\n+ Layout();\n+\n+ SizeToContents();\n+}\n+\n+bool OverflowBubbleView::OnMouseWheel(const views::MouseWheelEvent& event) {\n+ if (is_horizontal_alignment())\n+ ScrollByXOffset(-event.offset());\n+ else\n+ ScrollByYOffset(-event.offset());\n+ Layout();\n+\n+ return true;\n+}\n+\n+bool OverflowBubbleView::OnScrollEvent(const views::ScrollEvent & event) {\n+ ScrollByXOffset(-event.x_offset());\n+ ScrollByYOffset(-event.y_offset());\n+ Layout();\n+ return true;\n+}\n+\n+gfx::Rect OverflowBubbleView::GetBubbleBounds() {\n+ views::BubbleBorder* border = GetBubbleFrameView()->bubble_border();\n+ gfx::Insets bubble_insets;\n+ border->GetInsets(&bubble_insets);\n+\n+ const int border_size =\n+ views::BubbleBorder::is_arrow_on_horizontal(arrow_location()) ?\n+ bubble_insets.left() : bubble_insets.top();\n+ const int arrow_offset = border_size + kPadding + kLauncherViewLeadingInset +\n+ kLauncherPreferredSize / 2;\n+\n+ const gfx::Size content_size = GetPreferredSize();\n+ border->SetArrowOffset(arrow_offset, content_size);\n+\n+ const gfx::Rect anchor_rect = GetAnchorRect();\n+ gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds(\n+ anchor_rect,\n+ content_size,\n+ false);\n+\n+ gfx::Rect monitor_rect = gfx::Screen::GetDisplayNearestPoint(\n+ anchor_rect.CenterPoint()).work_area();\n+\n+ int offset = 0;\n+ if (views::BubbleBorder::is_arrow_on_horizontal(arrow_location())) {\n+ if (bubble_rect.x() < monitor_rect.x())\n+ offset = monitor_rect.x() - bubble_rect.x();\n+ else if (bubble_rect.right() > monitor_rect.right())\n+ offset = monitor_rect.right() - bubble_rect.right();\n+\n+ bubble_rect.Offset(offset, 0);\n+ border->SetArrowOffset(anchor_rect.CenterPoint().x() - bubble_rect.x(),\n+ content_size);\n+ } else {\n+ if (bubble_rect.y() < monitor_rect.y())\n+ offset = monitor_rect.y() - bubble_rect.y();\n+ else if (bubble_rect.bottom() > monitor_rect.bottom())\n+ offset = monitor_rect.bottom() - bubble_rect.bottom();\n+\n+ bubble_rect.Offset(0, offset);\n+ border->SetArrowOffset(anchor_rect.CenterPoint().y() - bubble_rect.y(),\n+ content_size);\n+ }\n+\n+ GetBubbleFrameView()->SchedulePaint();\n+ return bubble_rect;\n+}\n+\n+} // namespace\n+\n+OverflowBubble::OverflowBubble()\n+ : bubble_(NULL) {\n+}\n+\n+OverflowBubble::~OverflowBubble() {\n+ Hide();\n+}\n+\n+void OverflowBubble::Show(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index) {\n+ Hide();\n+\n+ OverflowBubbleView* bubble_view = new OverflowBubbleView();\n+ bubble_view->InitOverflowBubble(delegate,\n+ model,\n+ anchor,\n+ shelf_alignment,\n+ overflow_start_index);\n+\n+ bubble_ = bubble_view;\n+ bubble_->GetWidget()->AddObserver(this);\n+ bubble_->GetWidget()->Show();\n+}\n+\n+void OverflowBubble::Hide() {\n+ if (!IsShowing())\n+ return;\n+\n+ bubble_->GetWidget()->RemoveObserver(this);\n+ bubble_->GetWidget()->Close();\n+ bubble_ = NULL;\n+}\n+\n+void OverflowBubble::OnWidgetClosing(views::Widget* widget) {\n+ DCHECK(widget == bubble_->GetWidget());\n+ bubble_ = NULL;\n+}\n+\n+} // namespace internal\n+} // namespace ash"}<_**next**_>{"sha": "aa2d0e32f36a445cbf78a2a52b5e4978119fd3dc", "filename": "ash/launcher/overflow_bubble.h", "status": "added", "additions": 54, "deletions": 0, "changes": 54, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.h", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/launcher/overflow_bubble.h", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/launcher/overflow_bubble.h?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -0,0 +1,54 @@\n+// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n+// Use of this source code is governed by a BSD-style license that can be\n+// found in the LICENSE file.\n+\n+#ifndef ASH_LAUNCHER_OVERFLOW_BUBBLE_H_\n+#define ASH_LAUNCHER_OVERFLOW_BUBBLE_H_\n+\n+#include \"ash/wm/shelf_types.h\"\n+#include \"base/basictypes.h\"\n+#include \"base/compiler_specific.h\"\n+#include \"ui/views/widget/widget.h\"\n+\n+namespace views {\n+class View;\n+}\n+\n+namespace ash {\n+\n+class LauncherDelegate;\n+class LauncherModel;\n+\n+namespace internal {\n+\n+class LauncherView;\n+\n+// OverflowBubble displays an overflow bubble.\n+class OverflowBubble : public views::Widget::Observer {\n+ public:\n+ OverflowBubble();\n+ virtual ~OverflowBubble();\n+\n+ void Show(LauncherDelegate* delegate,\n+ LauncherModel* model,\n+ views::View* anchor,\n+ ShelfAlignment shelf_alignment,\n+ int overflow_start_index);\n+\n+ void Hide();\n+\n+ bool IsShowing() const { return !!bubble_; }\n+\n+ private:\n+ // views::Widget::Observer overrides:\n+ virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE;\n+\n+ views::View* bubble_; // Owned by views hierarchy.\n+\n+ DISALLOW_COPY_AND_ASSIGN(OverflowBubble);\n+};\n+\n+} // namespace internal\n+} // namespace ash\n+\n+#endif // ASH_LAUNCHER_OVERFLOW_BUBBLE_H_"}<_**next**_>{"sha": "455986f2fbfd73594447918e110c724386a63f89", "filename": "ash/wm/shelf_layout_manager.cc", "status": "modified", "additions": 3, "deletions": 0, "changes": 3, "blob_url": "https://github.com/chromium/chromium/blob/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/wm/shelf_layout_manager.cc", "raw_url": "https://github.com/chromium/chromium/raw/3475f5e448ddf5e48888f3d0563245cc46e3c98b/ash/wm/shelf_layout_manager.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/ash/wm/shelf_layout_manager.cc?ref=3475f5e448ddf5e48888f3d0563245cc46e3c98b", "patch": "@@ -542,6 +542,9 @@ ShelfLayoutManager::AutoHideState ShelfLayoutManager::CalculateAutoHideState(\n if (launcher_ && launcher_->IsShowingMenu())\n return AUTO_HIDE_SHOWN;\n \n+ if (launcher_ && launcher_->IsShowingOverflowBubble())\n+ return AUTO_HIDE_SHOWN;\n+\n if (launcher_widget()->IsActive() || status_->IsActive())\n return AUTO_HIDE_SHOWN;\n "}(...TRUNCATED)
| void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
(...TRUNCATED)
| void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
(...TRUNCATED)
|
C
| null | null | null | @@ -4,6 +4,8 @@
#include "ash/launcher/launcher.h"
+#include <algorithm>
+
#include "ash/focus_cycler.h"
#include "ash/launcher/launcher_delegate.h"
#include "ash/launcher/launcher_model.h"
@@ -33,7 +35,7 @@ const int kBackgroundAlpha = 128;
// The contents view of the Widget. This view contains LauncherView and
// sizes it to the width of the widget minus the size of the status area.
class Launcher::DelegateView : public views::WidgetDelegate,
- public views::AccessiblePaneView{
+ public views::AccessiblePaneView {
public:
explicit DelegateView(Launcher* launcher);
virtual ~DelegateView();
@@ -211,6 +213,10 @@ bool Launcher::IsShowingMenu() const {
return launcher_view_->IsShowingMenu();
}
+bool Launcher::IsShowingOverflowBubble() const {
+ return launcher_view_->IsShowingOverflowBubble();
+}
+
views::View* Launcher::GetAppListButtonView() const {
return launcher_view_->GetAppListButtonView();
}(...TRUNCATED)
|
Chrome
|
3475f5e448ddf5e48888f3d0563245cc46e3c98b
|
d72aa96b40382b63c0501be8d291cc42d1aa696d
| 0
| void set_focus_cycler(internal::FocusCycler* focus_cycler) {
focus_cycler_ = focus_cycler;
}
(...TRUNCATED)
|
118,895
| null |
Remote
|
Not required
| null |
CVE-2013-6626
|
https://www.cvedetails.com/cve/CVE-2013-6626/
| null |
Medium
| null |
Partial
| null |
2013-11-13
| 4.3
| The WebContentsImpl::AttachInterstitialPage function in content/browser/web_contents/web_contents_impl.cc in Google Chrome before 31.0.1650.48 does not cancel JavaScript dialogs upon generating an interstitial warning, which allows remote attackers to spoof the address bar via a crafted web site.(...TRUNCATED)
|
2017-09-18
| null | 0
|
https://github.com/chromium/chromium/commit/90fb08ed0146c9beacfd4dde98a20fc45419fff3
|
90fb08ed0146c9beacfd4dde98a20fc45419fff3
| Cancel JavaScript dialogs when an interstitial appears.
BUG=295695
TEST=See bug for repro steps.
Review URL: https://chromiumcodereview.appspot.com/24360011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225026 0039d316-1c4b-4281-b951-d872f2087c98(...TRUNCATED)
| 0
|
content/browser/web_contents/web_contents_impl.cc
| {"sha": "56901bcdfb435f9800494117dd64cd875f9a7148", "filename": "chrome/browser/ui/browser_browsertest.cc", "status": "modified", "additions": 48, "deletions": 0, "changes": 48, "blob_url": "https://github.com/chromium/chromium/blob/90fb08ed0146c9beacfd4dde98a20fc45419fff3/chrome/browser/ui/browser_browsertest.cc", "raw_url": "https://github.com/chromium/chromium/raw/90fb08ed0146c9beacfd4dde98a20fc45419fff3/chrome/browser/ui/browser_browsertest.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/chrome/browser/ui/browser_browsertest.cc?ref=90fb08ed0146c9beacfd4dde98a20fc45419fff3", "patch": "@@ -31,6 +31,7 @@\n #include \"chrome/browser/sessions/session_service_factory.h\"\n #include \"chrome/browser/translate/translate_tab_helper.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h\"\n+#include \"chrome/browser/ui/app_modal_dialogs/app_modal_dialog_queue.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/javascript_app_modal_dialog.h\"\n #include \"chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h\"\n #include \"chrome/browser/ui/browser.h\"\n@@ -1686,6 +1687,53 @@ IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCommandDisable) {\n EXPECT_TRUE(command_updater->IsCommandEnabled(IDC_ENCODING_MENU));\n }\n \n+// Ensure that creating an interstitial page closes any JavaScript dialogs\n+// that were present on the previous page. See http://crbug.com/295695.\n+IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialClosesDialogs) {\n+ ASSERT_TRUE(test_server()->Start());\n+ host_resolver()->AddRule(\"www.example.com\", \"127.0.0.1\");\n+ GURL url(test_server()->GetURL(\"empty.html\"));\n+ ui_test_utils::NavigateToURL(browser(), url);\n+\n+ WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();\n+ contents->GetRenderViewHost()->ExecuteJavascriptInWebFrame(\n+ string16(),\n+ ASCIIToUTF16(\"alert('Dialog showing!');\"));\n+ AppModalDialog* alert = ui_test_utils::WaitForAppModalDialog();\n+ EXPECT_TRUE(alert->IsValid());\n+ AppModalDialogQueue* dialog_queue = AppModalDialogQueue::GetInstance();\n+ EXPECT_TRUE(dialog_queue->HasActiveDialog());\n+\n+ TestInterstitialPage* interstitial = NULL;\n+ {\n+ scoped_refptr<content::MessageLoopRunner> loop_runner(\n+ new content::MessageLoopRunner);\n+\n+ InterstitialObserver observer(contents,\n+ loop_runner->QuitClosure(),\n+ base::Closure());\n+ interstitial = new TestInterstitialPage(contents, false, GURL());\n+ loop_runner->Run();\n+ }\n+\n+ // The interstitial should have closed the dialog.\n+ EXPECT_TRUE(contents->ShowingInterstitialPage());\n+ EXPECT_FALSE(dialog_queue->HasActiveDialog());\n+\n+ {\n+ scoped_refptr<content::MessageLoopRunner> loop_runner(\n+ new content::MessageLoopRunner);\n+\n+ InterstitialObserver observer(contents,\n+ base::Closure(),\n+ loop_runner->QuitClosure());\n+ interstitial->Proceed();\n+ loop_runner->Run();\n+ // interstitial is deleted now.\n+ }\n+}\n+\n+\n IN_PROC_BROWSER_TEST_F(BrowserTest, InterstitialCloseTab) {\n WebContents* contents = browser()->tab_strip_model()->GetActiveWebContents();\n "}<_**next**_>{"sha": "9c42e7c231561d0b913bac0799305fab369e1446", "filename": "content/browser/web_contents/web_contents_impl.cc", "status": "modified", "additions": 6, "deletions": 0, "changes": 6, "blob_url": "https://github.com/chromium/chromium/blob/90fb08ed0146c9beacfd4dde98a20fc45419fff3/content/browser/web_contents/web_contents_impl.cc", "raw_url": "https://github.com/chromium/chromium/raw/90fb08ed0146c9beacfd4dde98a20fc45419fff3/content/browser/web_contents/web_contents_impl.cc", "contents_url": "https://api.github.com/repos/chromium/chromium/contents/content/browser/web_contents/web_contents_impl.cc?ref=90fb08ed0146c9beacfd4dde98a20fc45419fff3", "patch": "@@ -1785,6 +1785,12 @@ void WebContentsImpl::AttachInterstitialPage(\n InterstitialPageImpl* interstitial_page) {\n DCHECK(interstitial_page);\n render_manager_.set_interstitial_page(interstitial_page);\n+\n+ // Cancel any visible dialogs so that they don't interfere with the\n+ // interstitial.\n+ if (dialog_manager_)\n+ dialog_manager_->CancelActiveAndPendingDialogs(this);\n+\n FOR_EACH_OBSERVER(WebContentsObserver, observers_,\n DidAttachInterstitialPage());\n }"}(...TRUNCATED)
| WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
(...TRUNCATED)
| WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
(...TRUNCATED)
|
C
| null | null | null | @@ -1785,6 +1785,12 @@ void WebContentsImpl::AttachInterstitialPage(
InterstitialPageImpl* interstitial_page) {
DCHECK(interstitial_page);
render_manager_.set_interstitial_page(interstitial_page);
+
+ // Cancel any visible dialogs so that they don't interfere with the
+ // interstitial.
+ if (dialog_manager_)
+ dialog_manager_->CancelActiveAndPendingDialogs(this);
+
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidAttachInterstitialPage());
}(...TRUNCATED)
|
Chrome
|
90fb08ed0146c9beacfd4dde98a20fc45419fff3
|
4165aa2c5c1f370d1535163e4f05c40af6aa141a
| 0
| WebContentsImpl::GetLastCommittedNavigationEntryForRenderManager() {
return controller_.GetLastCommittedEntry();
}
(...TRUNCATED)
|
89,316
| null |
Remote
|
Not required
|
Complete
|
CVE-2019-13106
|
https://www.cvedetails.com/cve/CVE-2019-13106/
|
CWE-787
|
Medium
|
Partial
|
Partial
| null |
2019-08-06
| 8.3
| "Das U-Boot versions 2016.09 through 2019.07-rc4 can memset() too much data while reading a crafted (...TRUNCATED)
|
2019-10-01
|
Exec Code Overflow
| 0
|
https://github.com/u-boot/u-boot/commits/master
|
master
| "Merge branch '2020-01-22-master-imports'\n\n- Re-add U8500 platform support\n- Add bcm968360bg supp(...TRUNCATED)
| 0
|
board/keymile/km_arm/km_arm.c
| "{\"sha\": \"b0634b23bc875a05240d75a402e639fddb5ec928\", \"filename\": \"MAINTAINERS\", \"status\": (...TRUNCATED)
| "static void set_bootcount_addr(void)\n{\n\tuchar buf[32];\n\tunsigned int bootcountaddr;\n\tbootcou(...TRUNCATED)
| "static void set_bootcount_addr(void)\n{\n\tuchar buf[32];\n\tunsigned int bootcountaddr;\n\tbootcou(...TRUNCATED)
|
C
| null | null | null | "@@ -69,11 +69,7 @@ static const u32 kwmpp_config[] = {\n \tMPP4_NF_IO6,\n \tMPP5_NF_IO7,\n \tMPP6_S(...TRUNCATED)
|
u-boot
|
master
|
052170c6a043eec4e73fad80955876cf1ba5e4f2
| 0
| "static void set_bootcount_addr(void)\n{\n\tuchar buf[32];\n\tunsigned int bootcountaddr;\n\tbootcou(...TRUNCATED)
|
126,863
| null |
Remote
|
Not required
|
Partial
|
CVE-2012-5148
|
https://www.cvedetails.com/cve/CVE-2012-5148/
|
CWE-20
|
Low
|
Partial
|
Partial
| null |
2013-01-15
| 7.5
| "The hyphenation functionality in Google Chrome before 24.0.1312.52 does not properly validate file (...TRUNCATED)
|
2018-10-30
| null | 0
|
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
|
e89cfcb9090e8c98129ae9160c513f504db74599
| "Remove TabContents from TabStripModelObserver::TabDetachedAt.\n\nBUG=107201\nTEST=no visible change(...TRUNCATED)
| 0
|
chrome/browser/ui/views/frame/browser_view.cc
| "{\"sha\": \"3494da8b6ee160b5f04f031be3e2cd52af5e3fdf\", \"filename\": \"chrome/browser/automation/a(...TRUNCATED)
| "void BrowserView::ShowChromeToMobileBubble() {\n GetLocationBarView()->ShowChromeToMobileBubble();(...TRUNCATED)
| "void BrowserView::ShowChromeToMobileBubble() {\n GetLocationBarView()->ShowChromeToMobileBubble();(...TRUNCATED)
|
C
| null | null | null | "@@ -1401,7 +1401,7 @@ ToolbarView* BrowserView::GetToolbarView() const {\n ////////////////////////(...TRUNCATED)
|
Chrome
|
e89cfcb9090e8c98129ae9160c513f504db74599
|
0c71b754680eb40b42ca1ce7a4e6fef7442b5da4
| 0
| "void BrowserView::ShowChromeToMobileBubble() {\n GetLocationBarView()->ShowChromeToMobileBubble();(...TRUNCATED)
|
152,065
| null |
Remote
|
Not required
|
Partial
|
CVE-2017-5019
|
https://www.cvedetails.com/cve/CVE-2017-5019/
|
CWE-416
|
Medium
|
Partial
|
Partial
| null |
2017-02-17
| 6.8
| "A use after free in Google Chrome prior to 56.0.2924.76 for Linux, Windows and Mac, and 56.0.2924.8(...TRUNCATED)
|
2018-01-04
| null | 0
|
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
| "Convert FrameHostMsg_DidAddMessageToConsole to Mojo.\n\nNote: Since this required changing the test(...TRUNCATED)
| 0
|
content/browser/frame_host/render_frame_host_impl.cc
| "{\"sha\": \"f2bd60be6f35037de28774456df91833dd753f20\", \"filename\": \"content/browser/frame_host/(...TRUNCATED)
| "void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,\n (...TRUNCATED)
| "void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,\n (...TRUNCATED)
|
C
| null | null | null | "@@ -1375,8 +1375,6 @@ bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) {\n \n (...TRUNCATED)
|
Chrome
|
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
|
c246049ec1b28d1af4fe3be886ac5904e1762026
| 0
| "void RenderFrameHostImpl::RequestAXTreeSnapshot(AXTreeSnapshotCallback callback,\n (...TRUNCATED)
|
60,944
| null |
Remote
|
Single system
| null |
CVE-2017-14604
|
https://www.cvedetails.com/cve/CVE-2017-14604/
|
CWE-20
|
Low
| null |
Partial
| null |
2017-09-20
| 4
| "GNOME Nautilus before 3.23.90 allows attackers to spoof a file type by using the .desktop file exte(...TRUNCATED)
|
2018-01-26
|
Exec Code
| 0
|
https://github.com/GNOME/nautilus/commit/1630f53481f445ada0a455e9979236d31a8d3bb0
|
1630f53481f445ada0a455e9979236d31a8d3bb0
| "mime-actions: use file metadata for trusting desktop files\n\nCurrently we only trust desktop files(...TRUNCATED)
| 0
|
src/nautilus-directory-async.c
| "{\"sha\": \"b02e3de87b10a1d07f6f8bdd3d9ec9febfe7a024\", \"filename\": \"src/nautilus-directory-asyn(...TRUNCATED)
| "mime_list_done (MimeListState *state,\n gboolean success)\n{\n NautilusFile(...TRUNCATED)
| "mime_list_done (MimeListState *state,\n gboolean success)\n{\n NautilusFile(...TRUNCATED)
|
C
| null | null | null | "@@ -30,6 +30,7 @@\n #include \"nautilus-global-preferences.h\"\n #include \"nautilus-link.h\"\n #in(...TRUNCATED)
|
nautilus
|
1630f53481f445ada0a455e9979236d31a8d3bb0
|
cc6910ff6511a5a2939cf36a49ca81fb62005382
| 0
| "mime_list_done (MimeListState *state,\n gboolean success)\n{\n NautilusFile(...TRUNCATED)
|
44,986
| null |
Remote
|
Not required
|
Partial
|
CVE-2015-0253
|
https://www.cvedetails.com/cve/CVE-2015-0253/
| null |
Low
| null | null | null |
2015-07-20
| 5
| "The read_request_line function in server/protocol.c in the Apache HTTP Server 2.4.12 does not initi(...TRUNCATED)
|
2018-01-04
|
DoS
| 0
|
https://github.com/apache/httpd/commit/6a974059190b8a0c7e499f4ab12fe108127099cb
|
6a974059190b8a0c7e499f4ab12fe108127099cb
| " *) SECURITY: CVE-2015-0253 (cve.mitre.org)\n core: Fix a crash introduced in with ErrorDocume(...TRUNCATED)
| 0
|
server/protocol.c
| "{\"sha\": \"064446d61118e9c799c51eb7105df54d7040af87\", \"filename\": \"CHANGES\", \"status\": \"mo(...TRUNCATED)
| "AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)\n{\n char *las(...TRUNCATED)
| "AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)\n{\n char *las(...TRUNCATED)
|
C
| null | null | null | "@@ -606,15 +606,15 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)\n (...TRUNCATED)
|
httpd
|
6a974059190b8a0c7e499f4ab12fe108127099cb
|
1fd42eb6471263a49b7a452b642163c111ce09f8
| 0
| "AP_DECLARE(void) ap_get_mime_headers_core(request_rec *r, apr_bucket_brigade *bb)\n{\n char *las(...TRUNCATED)
|
163,791
| null |
Remote
|
Not required
| null |
CVE-2017-15389
|
https://www.cvedetails.com/cve/CVE-2017-15389/
|
CWE-20
|
Medium
| null |
Partial
| null |
2018-02-07
| 4.3
| "An insufficient watchdog timer in navigation in Google Chrome prior to 62.0.3202.62 allowed a remot(...TRUNCATED)
|
2018-02-22
| null | 0
|
https://github.com/chromium/chromium/commit/5788690fb1395dc672ff9b3385dbfb1180ed710a
|
5788690fb1395dc672ff9b3385dbfb1180ed710a
| "mac: Make RWHVMac::ClearCompositorFrame clear locks\n\nEnsure that the BrowserCompositorMac not hol(...TRUNCATED)
| 0
|
content/browser/renderer_host/delegated_frame_host.cc
| "{\"sha\": \"4355a8cdacb4f8308554dadba4367f2923cabdae\", \"filename\": \"content/browser/renderer_ho(...TRUNCATED)
| "viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(\n viz::SurfaceHittestDelegate* delegate,\n (...TRUNCATED)
| "viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(\n viz::SurfaceHittestDelegate* delegate,\n (...TRUNCATED)
|
C
| null | null | null | "@@ -488,6 +488,11 @@ void DelegatedFrameHost::SubmitCompositorFrame(\n }\n \n void DelegatedFrameHo(...TRUNCATED)
|
Chrome
|
5788690fb1395dc672ff9b3385dbfb1180ed710a
|
6f0e3b2e552282301575d17cf664d3b1f5888302
| 0
| "viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint(\n viz::SurfaceHittestDelegate* delegate,\n (...TRUNCATED)
|
End of preview. Expand
in Data Studio
No dataset card yet
- Downloads last month
- 42